version 1.1.1.2, 2013/07/22 08:44:29
|
version 1.1.1.3, 2021/03/17 00:39:23
|
Line 16
|
Line 16
|
*/ |
*/ |
|
|
int |
int |
IpShowRoutes(Context ctx, int ac, char *av[], void *arg) | IpShowRoutes(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
FILE *fp; |
FILE *fp; |
char buf[256]; |
char buf[256]; |
char *c; |
char *c; |
|
|
|
(void)ac; |
|
(void)av; |
|
(void)arg; |
|
|
if ((fp = popen(PATH_NETSTAT " -nr -f inet", "r")) == NULL) |
if ((fp = popen(PATH_NETSTAT " -nr -f inet", "r")) == NULL) |
{ |
{ |
Perror("popen"); |
Perror("popen"); |
Line 179 ParseRange(const char *s, struct u_range *range, u_cha
|
Line 183 ParseRange(const char *s, struct u_range *range, u_cha
|
*/ |
*/ |
|
|
struct sockaddr_storage * |
struct sockaddr_storage * |
ParseAddrPort(int ac, char *av[], u_char allow) | ParseAddrPort(int ac, const char *const av[], u_char allow) |
{ |
{ |
static struct sockaddr_storage ss; |
static struct sockaddr_storage ss; |
struct u_addr addr; |
struct u_addr addr; |
Line 487 u_addrtoid(const struct u_addr *addr)
|
Line 491 u_addrtoid(const struct u_addr *addr)
|
if (addr->family==AF_INET) { |
if (addr->family==AF_INET) { |
id = ntohl(addr->u.ip4.s_addr); |
id = ntohl(addr->u.ip4.s_addr); |
} else if (addr->family==AF_INET6) { |
} else if (addr->family==AF_INET6) { |
uint32_t *a32 = (uint32_t *)(&addr->u.ip6.s6_addr[0]); | const uint32_t *a32 = (const uint32_t *)(const void *)(&addr->u.ip6.s6_addr[0]); |
id = a32[0] + a32[1] + a32[2] + a32[3]; |
id = a32[0] + a32[1] + a32[2] + a32[3]; |
} else { |
} else { |
id = 0; |
id = 0; |