rtnetlink.c (f6f6424ba773da6221ecaaa70973eb4dacfa03b2) rtnetlink.c (02637fce3e0103ba086b9c33b6d529e69460e4b6)
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>

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

864 + nla_total_size(1) /* IFLA_LINKMODE */
865 + nla_total_size(4) /* IFLA_CARRIER_CHANGES */
866 + nla_total_size(ext_filter_mask
867 & RTEXT_FILTER_VF ? 4 : 0) /* IFLA_NUM_VF */
868 + rtnl_vfinfo_size(dev, ext_filter_mask) /* IFLA_VFINFO_LIST */
869 + rtnl_port_size(dev, ext_filter_mask) /* IFLA_VF_PORTS + IFLA_PORT_SELF */
870 + rtnl_link_get_size(dev) /* IFLA_LINKINFO */
871 + rtnl_link_get_af_size(dev) /* IFLA_AF_SPEC */
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>

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

864 + nla_total_size(1) /* IFLA_LINKMODE */
865 + nla_total_size(4) /* IFLA_CARRIER_CHANGES */
866 + nla_total_size(ext_filter_mask
867 & RTEXT_FILTER_VF ? 4 : 0) /* IFLA_NUM_VF */
868 + rtnl_vfinfo_size(dev, ext_filter_mask) /* IFLA_VFINFO_LIST */
869 + rtnl_port_size(dev, ext_filter_mask) /* IFLA_VF_PORTS + IFLA_PORT_SELF */
870 + rtnl_link_get_size(dev) /* IFLA_LINKINFO */
871 + rtnl_link_get_af_size(dev) /* IFLA_AF_SPEC */
872 + nla_total_size(MAX_PHYS_PORT_ID_LEN); /* IFLA_PHYS_PORT_ID */
872 + nla_total_size(MAX_PHYS_ITEM_ID_LEN); /* IFLA_PHYS_PORT_ID */
873}
874
875static int rtnl_vf_ports_fill(struct sk_buff *skb, struct net_device *dev)
876{
877 struct nlattr *vf_ports;
878 struct nlattr *vf_port;
879 int vf;
880 int err;

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

948 }
949
950 return 0;
951}
952
953static int rtnl_phys_port_id_fill(struct sk_buff *skb, struct net_device *dev)
954{
955 int err;
873}
874
875static int rtnl_vf_ports_fill(struct sk_buff *skb, struct net_device *dev)
876{
877 struct nlattr *vf_ports;
878 struct nlattr *vf_port;
879 int vf;
880 int err;

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

948 }
949
950 return 0;
951}
952
953static int rtnl_phys_port_id_fill(struct sk_buff *skb, struct net_device *dev)
954{
955 int err;
956 struct netdev_phys_port_id ppid;
956 struct netdev_phys_item_id ppid;
957
958 err = dev_get_phys_port_id(dev, &ppid);
959 if (err) {
960 if (err == -EOPNOTSUPP)
961 return 0;
962 return err;
963 }
964

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

1192 [IFLA_VFINFO_LIST] = {. type = NLA_NESTED },
1193 [IFLA_VF_PORTS] = { .type = NLA_NESTED },
1194 [IFLA_PORT_SELF] = { .type = NLA_NESTED },
1195 [IFLA_AF_SPEC] = { .type = NLA_NESTED },
1196 [IFLA_EXT_MASK] = { .type = NLA_U32 },
1197 [IFLA_PROMISCUITY] = { .type = NLA_U32 },
1198 [IFLA_NUM_TX_QUEUES] = { .type = NLA_U32 },
1199 [IFLA_NUM_RX_QUEUES] = { .type = NLA_U32 },
957
958 err = dev_get_phys_port_id(dev, &ppid);
959 if (err) {
960 if (err == -EOPNOTSUPP)
961 return 0;
962 return err;
963 }
964

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

1192 [IFLA_VFINFO_LIST] = {. type = NLA_NESTED },
1193 [IFLA_VF_PORTS] = { .type = NLA_NESTED },
1194 [IFLA_PORT_SELF] = { .type = NLA_NESTED },
1195 [IFLA_AF_SPEC] = { .type = NLA_NESTED },
1196 [IFLA_EXT_MASK] = { .type = NLA_U32 },
1197 [IFLA_PROMISCUITY] = { .type = NLA_U32 },
1198 [IFLA_NUM_TX_QUEUES] = { .type = NLA_U32 },
1199 [IFLA_NUM_RX_QUEUES] = { .type = NLA_U32 },
1200 [IFLA_PHYS_PORT_ID] = { .type = NLA_BINARY, .len = MAX_PHYS_PORT_ID_LEN },
1200 [IFLA_PHYS_PORT_ID] = { .type = NLA_BINARY, .len = MAX_PHYS_ITEM_ID_LEN },
1201 [IFLA_CARRIER_CHANGES] = { .type = NLA_U32 }, /* ignored */
1202};
1203
1204static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
1205 [IFLA_INFO_KIND] = { .type = NLA_STRING },
1206 [IFLA_INFO_DATA] = { .type = NLA_NESTED },
1207 [IFLA_INFO_SLAVE_KIND] = { .type = NLA_STRING },
1208 [IFLA_INFO_SLAVE_DATA] = { .type = NLA_NESTED },

--- 1905 unchanged lines hidden ---
1201 [IFLA_CARRIER_CHANGES] = { .type = NLA_U32 }, /* ignored */
1202};
1203
1204static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
1205 [IFLA_INFO_KIND] = { .type = NLA_STRING },
1206 [IFLA_INFO_DATA] = { .type = NLA_NESTED },
1207 [IFLA_INFO_SLAVE_KIND] = { .type = NLA_STRING },
1208 [IFLA_INFO_SLAVE_DATA] = { .type = NLA_NESTED },

--- 1905 unchanged lines hidden ---