net_protocol
u16 net_protocol = ntohs(skb->protocol);
if (net_protocol == ETH_P_8021Q) {
net_protocol = ntohs(vh->h_vlan_encapsulated_proto);
switch (net_protocol) {
struct net_protocol tcp_protocol;
struct net_protocol udp_protocol;
int inet_add_protocol(const struct net_protocol *prot, unsigned char num);
int inet_del_protocol(const struct net_protocol *prot, unsigned char num);
extern struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS];
static const struct net_protocol igmp_protocol = {
static const struct net_protocol icmp_protocol = {
net_hotdata.udp_protocol = (struct net_protocol) {
net_hotdata.tcp_protocol = (struct net_protocol) {
const struct net_protocol *ipprot = rcu_dereference(inet_protos[proto]);
static const struct net_protocol net_gre_protocol = {
const struct net_protocol *ipprot;
const struct net_protocol *ipprot;
const struct net_protocol *ipprot;
static const struct net_protocol pim_protocol = {
struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS] __read_mostly;
int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol)
return !cmpxchg((const struct net_protocol **)&inet_protos[protocol],
int inet_del_protocol(const struct net_protocol *prot, unsigned char protocol)
ret = (cmpxchg((const struct net_protocol **)&inet_protos[protocol],
static const struct net_protocol tunnel4_protocol = {
static const struct net_protocol tunnel64_protocol = {
static const struct net_protocol tunnelmpls4_protocol = {
static const struct net_protocol udplite_protocol = {
static const struct net_protocol esp4_protocol = {
static const struct net_protocol ah4_protocol = {
static const struct net_protocol ipcomp4_protocol = {
static inline const struct net_protocol *netproto(unsigned char protocol)
static struct net_protocol l2tp_ip_protocol __read_mostly = {
static const struct net_protocol sctp_protocol = {