[NET] rename struct inet_protocol to net_protocol

The poor cousins will also have registration routines, etc.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@conectiva.com.br>
parent 0d072115
...@@ -34,8 +34,7 @@ ...@@ -34,8 +34,7 @@
/* This is used to register protocols. */ /* This is used to register protocols. */
struct inet_protocol struct net_protocol {
{
int (*handler)(struct sk_buff *skb); int (*handler)(struct sk_buff *skb);
void (*err_handler)(struct sk_buff *skb, u32 info); void (*err_handler)(struct sk_buff *skb, u32 info);
int no_policy; int no_policy;
...@@ -78,15 +77,15 @@ struct inet_protosw { ...@@ -78,15 +77,15 @@ struct inet_protosw {
#define INET_PROTOSW_REUSE 0x01 /* Are ports automatically reusable? */ #define INET_PROTOSW_REUSE 0x01 /* Are ports automatically reusable? */
#define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */ #define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */
extern struct inet_protocol *inet_protocol_base; extern struct net_protocol *inet_protocol_base;
extern struct inet_protocol *inet_protos[MAX_INET_PROTOS]; extern struct net_protocol *inet_protos[MAX_INET_PROTOS];
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS];
#endif #endif
extern int inet_add_protocol(struct inet_protocol *prot, unsigned char num); extern int inet_add_protocol(struct net_protocol *prot, unsigned char num);
extern int inet_del_protocol(struct inet_protocol *prot, unsigned char num); extern int inet_del_protocol(struct net_protocol *prot, unsigned char num);
extern void inet_register_protosw(struct inet_protosw *p); extern void inet_register_protosw(struct inet_protosw *p);
extern void inet_unregister_protosw(struct inet_protosw *p); extern void inet_unregister_protosw(struct inet_protosw *p);
......
...@@ -1041,24 +1041,24 @@ void inet_unregister_protosw(struct inet_protosw *p) ...@@ -1041,24 +1041,24 @@ void inet_unregister_protosw(struct inet_protosw *p)
} }
#ifdef CONFIG_IP_MULTICAST #ifdef CONFIG_IP_MULTICAST
static struct inet_protocol igmp_protocol = { static struct net_protocol igmp_protocol = {
.handler = igmp_rcv, .handler = igmp_rcv,
}; };
#endif #endif
static struct inet_protocol tcp_protocol = { static struct net_protocol tcp_protocol = {
.handler = tcp_v4_rcv, .handler = tcp_v4_rcv,
.err_handler = tcp_v4_err, .err_handler = tcp_v4_err,
.no_policy = 1, .no_policy = 1,
}; };
static struct inet_protocol udp_protocol = { static struct net_protocol udp_protocol = {
.handler = udp_rcv, .handler = udp_rcv,
.err_handler = udp_err, .err_handler = udp_err,
.no_policy = 1, .no_policy = 1,
}; };
static struct inet_protocol icmp_protocol = { static struct net_protocol icmp_protocol = {
.handler = icmp_rcv, .handler = icmp_rcv,
}; };
......
...@@ -340,7 +340,7 @@ static struct xfrm_type ah_type = ...@@ -340,7 +340,7 @@ static struct xfrm_type ah_type =
.output = ah_output .output = ah_output
}; };
static struct inet_protocol ah4_protocol = { static struct net_protocol ah4_protocol = {
.handler = xfrm4_rcv, .handler = xfrm4_rcv,
.err_handler = ah4_err, .err_handler = ah4_err,
.no_policy = 1, .no_policy = 1,
......
...@@ -594,7 +594,7 @@ static struct xfrm_type esp_type = ...@@ -594,7 +594,7 @@ static struct xfrm_type esp_type =
.output = esp_output .output = esp_output
}; };
static struct inet_protocol esp4_protocol = { static struct net_protocol esp4_protocol = {
.handler = xfrm4_rcv, .handler = xfrm4_rcv,
.err_handler = esp4_err, .err_handler = esp4_err,
.no_policy = 1, .no_policy = 1,
......
...@@ -592,7 +592,7 @@ static void icmp_unreach(struct sk_buff *skb) ...@@ -592,7 +592,7 @@ static void icmp_unreach(struct sk_buff *skb)
struct iphdr *iph; struct iphdr *iph;
struct icmphdr *icmph; struct icmphdr *icmph;
int hash, protocol; int hash, protocol;
struct inet_protocol *ipprot; struct net_protocol *ipprot;
struct sock *raw_sk; struct sock *raw_sk;
u32 info = 0; u32 info = 0;
......
...@@ -1240,7 +1240,7 @@ int __init ipgre_fb_tunnel_init(struct net_device *dev) ...@@ -1240,7 +1240,7 @@ int __init ipgre_fb_tunnel_init(struct net_device *dev)
} }
static struct inet_protocol ipgre_protocol = { static struct net_protocol ipgre_protocol = {
.handler = ipgre_rcv, .handler = ipgre_rcv,
.err_handler = ipgre_err, .err_handler = ipgre_err,
}; };
......
...@@ -223,7 +223,7 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb) ...@@ -223,7 +223,7 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
int protocol = skb->nh.iph->protocol; int protocol = skb->nh.iph->protocol;
int hash; int hash;
struct sock *raw_sk; struct sock *raw_sk;
struct inet_protocol *ipprot; struct net_protocol *ipprot;
resubmit: resubmit:
hash = protocol & (MAX_INET_PROTOS - 1); hash = protocol & (MAX_INET_PROTOS - 1);
......
...@@ -405,7 +405,7 @@ static struct xfrm_type ipcomp_type = { ...@@ -405,7 +405,7 @@ static struct xfrm_type ipcomp_type = {
.output = ipcomp_output .output = ipcomp_output
}; };
static struct inet_protocol ipcomp4_protocol = { static struct net_protocol ipcomp4_protocol = {
.handler = xfrm4_rcv, .handler = xfrm4_rcv,
.err_handler = ipcomp4_err, .err_handler = ipcomp4_err,
.no_policy = 1, .no_policy = 1,
......
...@@ -109,7 +109,7 @@ static int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local ...@@ -109,7 +109,7 @@ static int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local
static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert); static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert);
static int ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm); static int ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm);
static struct inet_protocol pim_protocol; static struct net_protocol pim_protocol;
static struct timer_list ipmr_expire_timer; static struct timer_list ipmr_expire_timer;
...@@ -1876,7 +1876,7 @@ static struct file_operations ipmr_mfc_fops = { ...@@ -1876,7 +1876,7 @@ static struct file_operations ipmr_mfc_fops = {
#endif #endif
#ifdef CONFIG_IP_PIMSM_V2 #ifdef CONFIG_IP_PIMSM_V2
static struct inet_protocol pim_protocol = { static struct net_protocol pim_protocol = {
.handler = pim_rcv, .handler = pim_rcv,
}; };
#endif #endif
......
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
#include <net/ipip.h> #include <net/ipip.h>
#include <linux/igmp.h> #include <linux/igmp.h>
struct inet_protocol *inet_protos[MAX_INET_PROTOS]; struct net_protocol *inet_protos[MAX_INET_PROTOS];
static spinlock_t inet_proto_lock = SPIN_LOCK_UNLOCKED; static spinlock_t inet_proto_lock = SPIN_LOCK_UNLOCKED;
/* /*
* Add a protocol handler to the hash tables * Add a protocol handler to the hash tables
*/ */
int inet_add_protocol(struct inet_protocol *prot, unsigned char protocol) int inet_add_protocol(struct net_protocol *prot, unsigned char protocol)
{ {
int hash, ret; int hash, ret;
...@@ -77,7 +77,7 @@ int inet_add_protocol(struct inet_protocol *prot, unsigned char protocol) ...@@ -77,7 +77,7 @@ int inet_add_protocol(struct inet_protocol *prot, unsigned char protocol)
* Remove a protocol from the hash tables. * Remove a protocol from the hash tables.
*/ */
int inet_del_protocol(struct inet_protocol *prot, unsigned char protocol) int inet_del_protocol(struct net_protocol *prot, unsigned char protocol)
{ {
int hash, ret; int hash, ret;
......
...@@ -167,7 +167,7 @@ static struct xfrm_type ipip_type = { ...@@ -167,7 +167,7 @@ static struct xfrm_type ipip_type = {
.output = ipip_output .output = ipip_output
}; };
static struct inet_protocol ipip_protocol = { static struct net_protocol ipip_protocol = {
.handler = ipip_rcv, .handler = ipip_rcv,
.err_handler = ipip_err, .err_handler = ipip_err,
.no_policy = 1, .no_policy = 1,
......
...@@ -800,7 +800,7 @@ int __init ipip6_fb_tunnel_init(struct net_device *dev) ...@@ -800,7 +800,7 @@ int __init ipip6_fb_tunnel_init(struct net_device *dev)
return 0; return 0;
} }
static struct inet_protocol sit_protocol = { static struct net_protocol sit_protocol = {
.handler = ipip6_rcv, .handler = ipip6_rcv,
.err_handler = ipip6_err, .err_handler = ipip6_err,
}; };
......
...@@ -875,7 +875,7 @@ static struct inet_protosw sctp_stream_protosw = { ...@@ -875,7 +875,7 @@ static struct inet_protosw sctp_stream_protosw = {
}; };
/* Register with IP layer. */ /* Register with IP layer. */
static struct inet_protocol sctp_protocol = { static struct net_protocol sctp_protocol = {
.handler = sctp_rcv, .handler = sctp_rcv,
.err_handler = sctp_v4_err, .err_handler = sctp_v4_err,
.no_policy = 1, .no_policy = 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment