aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/protocol.h')
-rw-r--r--include/net/protocol.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 929528c73fe8..047c0476c0a0 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -25,9 +25,11 @@
25#define _PROTOCOL_H 25#define _PROTOCOL_H
26 26
27#include <linux/in6.h> 27#include <linux/in6.h>
28#include <linux/skbuff.h>
28#if IS_ENABLED(CONFIG_IPV6) 29#if IS_ENABLED(CONFIG_IPV6)
29#include <linux/ipv6.h> 30#include <linux/ipv6.h>
30#endif 31#endif
32#include <linux/netdevice.h>
31 33
32/* This is one larger than the largest protocol value that can be 34/* This is one larger than the largest protocol value that can be
33 * found in an ipv4 or ipv6 header. Since in both cases the protocol 35 * found in an ipv4 or ipv6 header. Since in both cases the protocol
@@ -40,12 +42,6 @@ struct net_protocol {
40 void (*early_demux)(struct sk_buff *skb); 42 void (*early_demux)(struct sk_buff *skb);
41 int (*handler)(struct sk_buff *skb); 43 int (*handler)(struct sk_buff *skb);
42 void (*err_handler)(struct sk_buff *skb, u32 info); 44 void (*err_handler)(struct sk_buff *skb, u32 info);
43 int (*gso_send_check)(struct sk_buff *skb);
44 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
45 netdev_features_t features);
46 struct sk_buff **(*gro_receive)(struct sk_buff **head,
47 struct sk_buff *skb);
48 int (*gro_complete)(struct sk_buff *skb);
49 unsigned int no_policy:1, 45 unsigned int no_policy:1,
50 netns_ok:1; 46 netns_ok:1;
51}; 47};
@@ -60,23 +56,20 @@ struct inet6_protocol {
60 struct inet6_skb_parm *opt, 56 struct inet6_skb_parm *opt,
61 u8 type, u8 code, int offset, 57 u8 type, u8 code, int offset,
62 __be32 info); 58 __be32 info);
63
64 int (*gso_send_check)(struct sk_buff *skb);
65 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
66 netdev_features_t features);
67 struct sk_buff **(*gro_receive)(struct sk_buff **head,
68 struct sk_buff *skb);
69 int (*gro_complete)(struct sk_buff *skb);
70
71 unsigned int flags; /* INET6_PROTO_xxx */ 59 unsigned int flags; /* INET6_PROTO_xxx */
72}; 60};
73 61
74#define INET6_PROTO_NOPOLICY 0x1 62#define INET6_PROTO_NOPOLICY 0x1
75#define INET6_PROTO_FINAL 0x2 63#define INET6_PROTO_FINAL 0x2
76/* This should be set for any extension header which is compatible with GSO. */
77#define INET6_PROTO_GSO_EXTHDR 0x4
78#endif 64#endif
79 65
66struct net_offload {
67 struct offload_callbacks callbacks;
68 unsigned int flags; /* Flags used by IPv6 for now */
69};
70/* This should be set for any extension header which is compatible with GSO. */
71#define INET6_PROTO_GSO_EXTHDR 0x1
72
80/* This is used to register socket interfaces for IP protocols. */ 73/* This is used to register socket interfaces for IP protocols. */
81struct inet_protosw { 74struct inet_protosw {
82 struct list_head list; 75 struct list_head list;
@@ -96,6 +89,8 @@ struct inet_protosw {
96#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ 89#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */
97 90
98extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; 91extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS];
92extern const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS];
93extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS];
99 94
100#if IS_ENABLED(CONFIG_IPV6) 95#if IS_ENABLED(CONFIG_IPV6)
101extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; 96extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
@@ -103,6 +98,8 @@ extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
103 98
104extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); 99extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num);
105extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); 100extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num);
101extern int inet_add_offload(const struct net_offload *prot, unsigned char num);
102extern int inet_del_offload(const struct net_offload *prot, unsigned char num);
106extern void inet_register_protosw(struct inet_protosw *p); 103extern void inet_register_protosw(struct inet_protosw *p);
107extern void inet_unregister_protosw(struct inet_protosw *p); 104extern void inet_unregister_protosw(struct inet_protosw *p);
108 105
@@ -112,5 +109,7 @@ extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char n
112extern int inet6_register_protosw(struct inet_protosw *p); 109extern int inet6_register_protosw(struct inet_protosw *p);
113extern void inet6_unregister_protosw(struct inet_protosw *p); 110extern void inet6_unregister_protosw(struct inet_protosw *p);
114#endif 111#endif
112extern int inet6_add_offload(const struct net_offload *prot, unsigned char num);
113extern int inet6_del_offload(const struct net_offload *prot, unsigned char num);
115 114
116#endif /* _PROTOCOL_H */ 115#endif /* _PROTOCOL_H */