rtnetlink.c (3a37471551cd3b287ce7f02ed25bcf8ec37a191d) rtnetlink.c (bf74b20d00b13919db7ae5d1015636e76f56f6ae)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 4102 unchanged lines hidden (view full) ---

4111 rtnl_unlock();
4112}
4113
4114static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr)
4115{
4116 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
4117
4118 switch (event) {
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 4102 unchanged lines hidden (view full) ---

4111 rtnl_unlock();
4112}
4113
4114static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr)
4115{
4116 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
4117
4118 switch (event) {
4119 case NETDEV_UP:
4120 case NETDEV_DOWN:
4121 case NETDEV_PRE_UP:
4122 case NETDEV_POST_INIT:
4123 case NETDEV_REGISTER:
4124 case NETDEV_CHANGE:
4125 case NETDEV_PRE_TYPE_CHANGE:
4126 case NETDEV_GOING_DOWN:
4127 case NETDEV_UNREGISTER:
4128 case NETDEV_UNREGISTER_FINAL:
4129 case NETDEV_RELEASE:
4130 case NETDEV_JOIN:
4131 case NETDEV_BONDING_INFO:
4119 case NETDEV_REBOOT:
4120 case NETDEV_CHANGEMTU:
4121 case NETDEV_CHANGEADDR:
4122 case NETDEV_CHANGENAME:
4123 case NETDEV_FEAT_CHANGE:
4124 case NETDEV_BONDING_FAILOVER:
4125 case NETDEV_POST_TYPE_CHANGE:
4126 case NETDEV_NOTIFY_PEERS:
4127 case NETDEV_CHANGEUPPER:
4128 case NETDEV_RESEND_IGMP:
4129 case NETDEV_PRECHANGEMTU:
4130 case NETDEV_CHANGEINFODATA:
4131 case NETDEV_PRECHANGEUPPER:
4132 case NETDEV_CHANGELOWERSTATE:
4133 case NETDEV_UDP_TUNNEL_PUSH_INFO:
4134 case NETDEV_CHANGE_TX_QUEUE_LEN:
4135 rtmsg_ifinfo(RTM_NEWLINK, dev, 0, GFP_KERNEL);
4132 break;
4133 default:
4136 break;
4137 default:
4134 rtmsg_ifinfo(RTM_NEWLINK, dev, 0, GFP_KERNEL);
4135 break;
4136 }
4137 return NOTIFY_DONE;
4138}
4139
4140static struct notifier_block rtnetlink_dev_notifier = {
4141 .notifier_call = rtnetlink_event,
4142};

--- 37 unchanged lines hidden (view full) ---

4180 rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink,
4181 rtnl_dump_ifinfo, rtnl_calcit);
4182 rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL, NULL);
4183 rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL, NULL);
4184 rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL, NULL);
4185
4186 rtnl_register(PF_UNSPEC, RTM_GETADDR, NULL, rtnl_dump_all, NULL);
4187 rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all, NULL);
4138 break;
4139 }
4140 return NOTIFY_DONE;
4141}
4142
4143static struct notifier_block rtnetlink_dev_notifier = {
4144 .notifier_call = rtnetlink_event,
4145};

--- 37 unchanged lines hidden (view full) ---

4183 rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink,
4184 rtnl_dump_ifinfo, rtnl_calcit);
4185 rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL, NULL);
4186 rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL, NULL);
4187 rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL, NULL);
4188
4189 rtnl_register(PF_UNSPEC, RTM_GETADDR, NULL, rtnl_dump_all, NULL);
4190 rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all, NULL);
4191 rtnl_register(PF_UNSPEC, RTM_GETNETCONF, NULL, rtnl_dump_all, NULL);
4188
4189 rtnl_register(PF_BRIDGE, RTM_NEWNEIGH, rtnl_fdb_add, NULL, NULL);
4190 rtnl_register(PF_BRIDGE, RTM_DELNEIGH, rtnl_fdb_del, NULL, NULL);
4191 rtnl_register(PF_BRIDGE, RTM_GETNEIGH, NULL, rtnl_fdb_dump, NULL);
4192
4193 rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL, rtnl_bridge_getlink, NULL);
4194 rtnl_register(PF_BRIDGE, RTM_DELLINK, rtnl_bridge_dellink, NULL, NULL);
4195 rtnl_register(PF_BRIDGE, RTM_SETLINK, rtnl_bridge_setlink, NULL, NULL);
4196
4197 rtnl_register(PF_UNSPEC, RTM_GETSTATS, rtnl_stats_get, rtnl_stats_dump,
4198 NULL);
4199}
4192
4193 rtnl_register(PF_BRIDGE, RTM_NEWNEIGH, rtnl_fdb_add, NULL, NULL);
4194 rtnl_register(PF_BRIDGE, RTM_DELNEIGH, rtnl_fdb_del, NULL, NULL);
4195 rtnl_register(PF_BRIDGE, RTM_GETNEIGH, NULL, rtnl_fdb_dump, NULL);
4196
4197 rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL, rtnl_bridge_getlink, NULL);
4198 rtnl_register(PF_BRIDGE, RTM_DELLINK, rtnl_bridge_dellink, NULL, NULL);
4199 rtnl_register(PF_BRIDGE, RTM_SETLINK, rtnl_bridge_setlink, NULL, NULL);
4200
4201 rtnl_register(PF_UNSPEC, RTM_GETSTATS, rtnl_stats_get, rtnl_stats_dump,
4202 NULL);
4203}