path: root/include
diff options
authorMatthias Schiffer <>2018-03-04 09:28:56 +0100
committerPablo Neira Ayuso <>2018-04-11 10:09:35 +0200
commitc5e5b784fd1a919b8dd34a4d9e88c8d022f259bf (patch)
tree18b3516f172cc45ec12767274a158f550363a24c /include
parent11da521771963720302449d68995a1b159a00559 (diff)
Move ICMP type handling functions from ebt_ip6 to useful_functions.c
Allow using these functions for ebt_ip as well. Signed-off-by: Matthias Schiffer <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include')
1 files changed, 16 insertions, 1 deletions
diff --git a/include/ebtables_u.h b/include/ebtables_u.h
index 35a5bcc..17afa94 100644
--- a/include/ebtables_u.h
+++ b/include/ebtables_u.h
@@ -222,6 +222,15 @@ struct ebt_u_target
struct ebt_u_target *next;
+struct ebt_icmp_names {
+ const char *name;
+ uint8_t type;
+ uint8_t code_min, code_max;
/* libebtc.c */
extern struct ebt_u_table *ebt_tables;
@@ -300,11 +309,17 @@ void ebt_print_mac_and_mask(const unsigned char *mac, const unsigned char *mask)
int ebt_get_mac_and_mask(const char *from, unsigned char *to, unsigned char *mask);
void ebt_parse_ip_address(char *address, uint32_t *addr, uint32_t *msk);
char *ebt_mask_to_dotted(uint32_t mask);
-void ebt_parse_ip6_address(char *address, struct in6_addr *addr,
+void ebt_parse_ip6_address(char *address, struct in6_addr *addr,
struct in6_addr *msk);
char *ebt_ip6_to_numeric(const struct in6_addr *addrp);
char *ebt_ip6_mask_to_string(const struct in6_addr *msk);
+int ebt_parse_icmp(const struct ebt_icmp_names *icmp_codes, size_t n_codes,
+ const char *icmptype, uint8_t type[], uint8_t code[]);
+void ebt_print_icmp_type(const struct ebt_icmp_names *icmp_codes,
+ size_t n_codes, uint8_t *type, uint8_t *code);
+void ebt_print_icmp_types(const struct ebt_icmp_names *icmp_codes,
+ size_t n_codes);
int do_command(int argc, char *argv[], int exec_style,
struct ebt_u_replace *replace_);