1#ifndef _IP_SET_GETPORT_H
2#define _IP_SET_GETPORT_H
3
4extern 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)
8extern bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
9				__be16 *port, u8 *proto);
10#else
11static 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
18extern bool ip_set_get_ip_port(const struct sk_buff *skb, u8 pf, bool src,
19				__be16 *port);
20
21static inline bool ip_set_proto_with_ports(u8 proto)
22{
23	switch (proto) {
24	case IPPROTO_TCP:
25	case IPPROTO_SCTP:
26	case IPPROTO_UDP:
27	case IPPROTO_UDPLITE:
28		return true;
29	}
30	return false;
31}
32
33#endif /*_IP_SET_GETPORT_H*/
34