Skip to content

Commit

Permalink
sa: add sa_pton()
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Jun 23, 2021
1 parent 1a48ef6 commit 6c1a3b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/re_sa.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ int sa_af(const struct sa *sa);
uint32_t sa_in(const struct sa *sa);
void sa_in6(const struct sa *sa, uint8_t *addr);
int sa_ntop(const struct sa *sa, char *buf, int size);
int sa_pton(const char *addr, struct sa *sa);
uint16_t sa_port(const struct sa *sa);
bool sa_isset(const struct sa *sa, int flag);
uint32_t sa_hash(const struct sa *sa, int flag);
Expand Down
4 changes: 2 additions & 2 deletions src/sa/sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int sa_set(struct sa *sa, const struct pl *addr, uint16_t port)
*
* @return 0 if success, otherwise errorcode
*/
static int net_inet_pton(const char *addr, struct sa *sa)
int sa_pton(const char *addr, struct sa *sa)
{
if (!addr)
return EINVAL;
Expand Down Expand Up @@ -111,7 +111,7 @@ int sa_set_str(struct sa *sa, const char *addr, uint16_t port)
if (!sa || !addr)
return EINVAL;

err = net_inet_pton(addr, sa);
err = sa_pton(addr, sa);
if (err)
return err;

Expand Down

0 comments on commit 6c1a3b3

Please sign in to comment.