/* set the ip mask and ip address */ void parse_ip_address(char *address, uint32_t *addr, uint32_t *msk) { char *p; /* first the mask */ if ((p = strrchr(address, '/')) != NULL) { *p = '\0'; if (ip_mask(p + 1, (unsigned char *)msk)) print_error("Problem with the IP mask"); } else *msk = 0xFFFFFFFF; if (undot_ip(address, (unsigned char *)addr)) print_error("Problem with the IP address"); *addr = *addr & *msk; }
void ebt_parse_ip_address(char *address, uint32_t *addr, uint32_t *msk) { char *p; if ((p = strrchr(address, '/')) != NULL) { *p = '\0'; if (ip_mask(p + 1, (unsigned char *)msk)) { ebt_print_error("Problem with the IP mask '%s'", p + 1); return; } } else *msk = 0xFFFFFFFF; if (undot_ip(address, (unsigned char *)addr)) { ebt_print_error("Problem with the IP address '%s'", address); return; } *addr = *addr & *msk; }
static void ebt_parse_ip_address(char *address, uint32_t *addr, uint32_t *msk) { char *p; /* first the mask */ if ((p = strrchr(address, '/')) != NULL) { *p = '\0'; if (ip_mask(p + 1, (unsigned char *)msk)) { xtables_error(PARAMETER_PROBLEM, "Problem with the IP mask '%s'", p + 1); return; } } else *msk = 0xFFFFFFFF; if (undot_ip(address, (unsigned char *)addr)) { xtables_error(PARAMETER_PROBLEM, "Problem with the IP address '%s'", address); return; } *addr = *addr & *msk; }