act_vlan.c (7be8ef2cdbfe41a2e524b7c6cc3f8e6cfaa906e4) act_vlan.c (b35475c5491a14c8ce7a5046ef7bcda8a860581a)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
4 */
5
6#include <linux/module.h>
7#include <linux/init.h>
8#include <linux/kernel.h>

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

303
304static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 index)
305{
306 struct tc_action_net *tn = net_generic(net, vlan_net_id);
307
308 return tcf_idr_search(tn, a, index);
309}
310
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
4 */
5
6#include <linux/module.h>
7#include <linux/init.h>
8#include <linux/kernel.h>

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

303
304static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 index)
305{
306 struct tc_action_net *tn = net_generic(net, vlan_net_id);
307
308 return tcf_idr_search(tn, a, index);
309}
310
311static size_t tcf_vlan_get_fill_size(const struct tc_action *act)
312{
313 return nla_total_size(sizeof(struct tc_vlan))
314 + nla_total_size(sizeof(u16)) /* TCA_VLAN_PUSH_VLAN_ID */
315 + nla_total_size(sizeof(u16)) /* TCA_VLAN_PUSH_VLAN_PROTOCOL */
316 + nla_total_size(sizeof(u8)); /* TCA_VLAN_PUSH_VLAN_PRIORITY */
317}
318
311static struct tc_action_ops act_vlan_ops = {
312 .kind = "vlan",
313 .id = TCA_ID_VLAN,
314 .owner = THIS_MODULE,
315 .act = tcf_vlan_act,
316 .dump = tcf_vlan_dump,
317 .init = tcf_vlan_init,
318 .cleanup = tcf_vlan_cleanup,
319 .walk = tcf_vlan_walker,
319static struct tc_action_ops act_vlan_ops = {
320 .kind = "vlan",
321 .id = TCA_ID_VLAN,
322 .owner = THIS_MODULE,
323 .act = tcf_vlan_act,
324 .dump = tcf_vlan_dump,
325 .init = tcf_vlan_init,
326 .cleanup = tcf_vlan_cleanup,
327 .walk = tcf_vlan_walker,
328 .get_fill_size = tcf_vlan_get_fill_size,
320 .lookup = tcf_vlan_search,
321 .size = sizeof(struct tcf_vlan),
322};
323
324static __net_init int vlan_init_net(struct net *net)
325{
326 struct tc_action_net *tn = net_generic(net, vlan_net_id);
327

--- 31 unchanged lines hidden ---
329 .lookup = tcf_vlan_search,
330 .size = sizeof(struct tcf_vlan),
331};
332
333static __net_init int vlan_init_net(struct net *net)
334{
335 struct tc_action_net *tn = net_generic(net, vlan_net_id);
336

--- 31 unchanged lines hidden ---