Lines Matching full:protocol
1 /* xfrm6_protocol.c - Generic xfrm protocol multiplexer for ipv6.
22 #include <net/protocol.h>
30 static inline struct xfrm6_protocol __rcu **proto_handlers(u8 protocol) in proto_handlers() argument
32 switch (protocol) { in proto_handlers()
49 int xfrm6_rcv_cb(struct sk_buff *skb, u8 protocol, int err) in xfrm6_rcv_cb() argument
53 struct xfrm6_protocol __rcu **head = proto_handlers(protocol); in xfrm6_rcv_cb()
58 for_each_protocol_rcu(*proto_handlers(protocol), handler) in xfrm6_rcv_cb()
170 static inline const struct inet6_protocol *netproto(unsigned char protocol) in netproto() argument
172 switch (protocol) { in netproto()
185 unsigned char protocol) in xfrm6_protocol_register() argument
193 if (!proto_handlers(protocol) || !netproto(protocol)) in xfrm6_protocol_register()
198 if (!rcu_dereference_protected(*proto_handlers(protocol), in xfrm6_protocol_register()
202 for (pprev = proto_handlers(protocol); in xfrm6_protocol_register()
221 if (inet6_add_protocol(netproto(protocol), protocol)) { in xfrm6_protocol_register()
222 pr_err("%s: can't add protocol\n", __func__); in xfrm6_protocol_register()
232 unsigned char protocol) in xfrm6_protocol_deregister() argument
238 if (!proto_handlers(protocol) || !netproto(protocol)) in xfrm6_protocol_deregister()
243 for (pprev = proto_handlers(protocol); in xfrm6_protocol_deregister()
254 if (!rcu_dereference_protected(*proto_handlers(protocol), in xfrm6_protocol_deregister()
256 if (inet6_del_protocol(netproto(protocol), protocol) < 0) { in xfrm6_protocol_deregister()
257 pr_err("%s: can't remove protocol\n", __func__); in xfrm6_protocol_deregister()