#include <string.h>
#include <errno.h>
#include <switch.h>
Go to the source code of this file.
static int inet_pton4 |
( |
const char * |
src, |
|
|
unsigned char * |
dst |
|
) |
| |
|
static |
Definition at line 103 of file inet_pton.c.
References INADDRSZ.
Referenced by switch_inet_pton().
105 static const char digits[] =
"0123456789";
106 int saw_digit, octets, ch;
113 while ((ch = *src++) !=
'\0') {
116 if ((pch = strchr(digits, ch)) != NULL) {
117 unsigned int val = *tp * 10 + (
unsigned int) (pch - digits);
121 *tp = (
unsigned char) val;
127 }
else if (ch ==
'.' && saw_digit) {
int switch_inet_pton |
( |
int |
af, |
|
|
const char * |
src, |
|
|
void * |
dst |
|
) |
| |
Definition at line 74 of file inet_pton.c.
References inet_pton4().
78 return (
inet_pton4(src, (
unsigned char *) dst));
81 #define AF_INET6 (AF_MAX+1)
84 return (inet_pton6(src, (
unsigned char *) dst));
static int inet_pton4(const char *src, unsigned char *dst)