aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/protocol.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/net/protocol.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'include/net/protocol.h')
-rw-r--r--include/net/protocol.h49
1 files changed, 22 insertions, 27 deletions
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 047c0476c0a..6f7eb800974 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -25,50 +25,51 @@
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 defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
29#if IS_ENABLED(CONFIG_IPV6)
30#include <linux/ipv6.h> 29#include <linux/ipv6.h>
31#endif 30#endif
32#include <linux/netdevice.h>
33 31
34/* This is one larger than the largest protocol value that can be 32#define MAX_INET_PROTOS 256 /* Must be a power of 2 */
35 * found in an ipv4 or ipv6 header. Since in both cases the protocol 33
36 * value is presented in a __u8, this is defined to be 256.
37 */
38#define MAX_INET_PROTOS 256
39 34
40/* This is used to register protocols. */ 35/* This is used to register protocols. */
41struct net_protocol { 36struct net_protocol {
42 void (*early_demux)(struct sk_buff *skb);
43 int (*handler)(struct sk_buff *skb); 37 int (*handler)(struct sk_buff *skb);
44 void (*err_handler)(struct sk_buff *skb, u32 info); 38 void (*err_handler)(struct sk_buff *skb, u32 info);
39 int (*gso_send_check)(struct sk_buff *skb);
40 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
41 u32 features);
42 struct sk_buff **(*gro_receive)(struct sk_buff **head,
43 struct sk_buff *skb);
44 int (*gro_complete)(struct sk_buff *skb);
45 unsigned int no_policy:1, 45 unsigned int no_policy:1,
46 netns_ok:1; 46 netns_ok:1;
47}; 47};
48 48
49#if IS_ENABLED(CONFIG_IPV6) 49#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
50struct inet6_protocol { 50struct inet6_protocol {
51 void (*early_demux)(struct sk_buff *skb);
52
53 int (*handler)(struct sk_buff *skb); 51 int (*handler)(struct sk_buff *skb);
54 52
55 void (*err_handler)(struct sk_buff *skb, 53 void (*err_handler)(struct sk_buff *skb,
56 struct inet6_skb_parm *opt, 54 struct inet6_skb_parm *opt,
57 u8 type, u8 code, int offset, 55 u8 type, u8 code, int offset,
58 __be32 info); 56 __be32 info);
57
58 int (*gso_send_check)(struct sk_buff *skb);
59 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
60 u32 features);
61 struct sk_buff **(*gro_receive)(struct sk_buff **head,
62 struct sk_buff *skb);
63 int (*gro_complete)(struct sk_buff *skb);
64
59 unsigned int flags; /* INET6_PROTO_xxx */ 65 unsigned int flags; /* INET6_PROTO_xxx */
60}; 66};
61 67
62#define INET6_PROTO_NOPOLICY 0x1 68#define INET6_PROTO_NOPOLICY 0x1
63#define INET6_PROTO_FINAL 0x2 69#define INET6_PROTO_FINAL 0x2
64#endif
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. */ 70/* This should be set for any extension header which is compatible with GSO. */
71#define INET6_PROTO_GSO_EXTHDR 0x1 71#define INET6_PROTO_GSO_EXTHDR 0x4
72#endif
72 73
73/* This is used to register socket interfaces for IP protocols. */ 74/* This is used to register socket interfaces for IP protocols. */
74struct inet_protosw { 75struct inet_protosw {
@@ -89,27 +90,21 @@ struct inet_protosw {
89#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ 90#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */
90 91
91extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; 92extern 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];
94 93
95#if IS_ENABLED(CONFIG_IPV6) 94#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
96extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; 95extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
97#endif 96#endif
98 97
99extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); 98extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num);
100extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); 99extern 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);
103extern void inet_register_protosw(struct inet_protosw *p); 100extern void inet_register_protosw(struct inet_protosw *p);
104extern void inet_unregister_protosw(struct inet_protosw *p); 101extern void inet_unregister_protosw(struct inet_protosw *p);
105 102
106#if IS_ENABLED(CONFIG_IPV6) 103#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
107extern int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); 104extern int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num);
108extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); 105extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num);
109extern int inet6_register_protosw(struct inet_protosw *p); 106extern int inet6_register_protosw(struct inet_protosw *p);
110extern void inet6_unregister_protosw(struct inet_protosw *p); 107extern void inet6_unregister_protosw(struct inet_protosw *p);
111#endif 108#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);
114 109
115#endif /* _PROTOCOL_H */ 110#endif /* _PROTOCOL_H */