Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
firewall_rules.h
1 /* firewall_rules.h
2  * Produce ACL rules for various products from a packet.
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 2006 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef __UI_FIREWALL_RULES_H__
12 #define __UI_FIREWALL_RULES_H__
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17 
18 /* Rule types */
19 typedef enum {
20  RT_NONE,
21  RT_MAC_SRC,
22  RT_MAC_DST,
23  RT_IPv4_SRC,
24  RT_IPv4_DST,
25  RT_PORT_SRC,
26  RT_PORT_DST,
27  RT_IPv4_PORT_SRC,
28  RT_IPv4_PORT_DST,
29  NUM_RULE_TYPES
30 } rule_type_e;
31 
36 size_t firewall_product_count(void);
37 
43 const char *firewall_product_name(size_t product_idx);
44 
50 const char *firewall_product_rule_hint(size_t product_idx);
51 
56 const char *firewall_product_comment_prefix(size_t product_idx);
57 
58 /* Syntax function prototypes */
59 typedef void (*syntax_func)(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
60 
65 syntax_func firewall_product_mac_func(size_t product_idx);
66 
71 syntax_func firewall_product_ipv4_func(size_t product_idx);
72 
77 syntax_func firewall_product_port_func(size_t product_idx);
78 
83 syntax_func firewall_product_ipv4_port_func(size_t product_idx);
84 
90 gboolean firewall_product_does_inbound(size_t product_idx);
91 
92 #ifdef __cplusplus
93 }
94 #endif /* __cplusplus */
95 
96 #endif /* __UI_FIREWALL_RULES_H__ */