xref: /linux/include/linux/netfilter/ipset/ip_set_getport.h (revision e9fb13bfec7e017130ddc5c1b5466340470f4900)
1 #ifndef _IP_SET_GETPORT_H
2 #define _IP_SET_GETPORT_H
3 
4 extern bool ip_set_get_ip4_port(const struct sk_buff *skb, bool src,
5 				__be16 *port, u8 *proto);
6 
7 #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
8 extern bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
9 				__be16 *port, u8 *proto);
10 #else
11 static inline bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
12 				       __be16 *port, u8 *proto)
13 {
14 	return false;
15 }
16 #endif
17 
18 extern bool ip_set_get_ip_port(const struct sk_buff *skb, u8 pf, bool src,
19 				__be16 *port);
20 
21 static inline bool ip_set_proto_with_ports(u8 proto)
22 {
23 	switch (proto) {
24 	case IPPROTO_TCP:
25 	case IPPROTO_UDP:
26 		return true;
27 	}
28 	return false;
29 }
30 
31 #endif /*_IP_SET_GETPORT_H*/
32