vlan_netlink.c (ebf8889bd1fe3615991ff4494635d237280652a2) vlan_netlink.c (af30151709bcace1ca844d4bb8b7e2e392ff81eb)
1/*
2 * VLAN netlink control interface
3 *
4 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.

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

132
133 err = vlan_changelink(dev, tb, data);
134 if (err < 0)
135 return err;
136
137 return register_vlan_dev(dev);
138}
139
1/*
2 * VLAN netlink control interface
3 *
4 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.

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

132
133 err = vlan_changelink(dev, tb, data);
134 if (err < 0)
135 return err;
136
137 return register_vlan_dev(dev);
138}
139
140static void vlan_dellink(struct net_device *dev)
141{
142 unregister_vlan_device(dev);
143}
144
145static inline size_t vlan_qos_map_size(unsigned int n)
146{
147 if (n == 0)
148 return 0;
149 /* IFLA_VLAN_{EGRESS,INGRESS}_QOS + n * IFLA_VLAN_QOS_MAPPING */
150 return nla_total_size(sizeof(struct nlattr)) +
151 nla_total_size(sizeof(struct ifla_vlan_qos_mapping)) * n;
152}

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

221 .kind = "vlan",
222 .maxtype = IFLA_VLAN_MAX,
223 .policy = vlan_policy,
224 .priv_size = sizeof(struct vlan_dev_info),
225 .setup = vlan_setup,
226 .validate = vlan_validate,
227 .newlink = vlan_newlink,
228 .changelink = vlan_changelink,
140static inline size_t vlan_qos_map_size(unsigned int n)
141{
142 if (n == 0)
143 return 0;
144 /* IFLA_VLAN_{EGRESS,INGRESS}_QOS + n * IFLA_VLAN_QOS_MAPPING */
145 return nla_total_size(sizeof(struct nlattr)) +
146 nla_total_size(sizeof(struct ifla_vlan_qos_mapping)) * n;
147}

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

216 .kind = "vlan",
217 .maxtype = IFLA_VLAN_MAX,
218 .policy = vlan_policy,
219 .priv_size = sizeof(struct vlan_dev_info),
220 .setup = vlan_setup,
221 .validate = vlan_validate,
222 .newlink = vlan_newlink,
223 .changelink = vlan_changelink,
229 .dellink = vlan_dellink,
224 .dellink = unregister_vlan_dev,
230 .get_size = vlan_get_size,
231 .fill_info = vlan_fill_info,
232};
233
234int __init vlan_netlink_init(void)
235{
236 return rtnl_link_register(&vlan_link_ops);
237}
238
239void __exit vlan_netlink_fini(void)
240{
241 rtnl_link_unregister(&vlan_link_ops);
242}
243
244MODULE_ALIAS_RTNL_LINK("vlan");
225 .get_size = vlan_get_size,
226 .fill_info = vlan_fill_info,
227};
228
229int __init vlan_netlink_init(void)
230{
231 return rtnl_link_register(&vlan_link_ops);
232}
233
234void __exit vlan_netlink_fini(void)
235{
236 rtnl_link_unregister(&vlan_link_ops);
237}
238
239MODULE_ALIAS_RTNL_LINK("vlan");