Loading...
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * net/sched/act_skbmod.c skb data modifier
4 *
5 * Copyright (c) 2016 Jamal Hadi Salim <jhs@mojatatu.com>
6*/
7
8#include <linux/module.h>
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/skbuff.h>
12#include <linux/rtnetlink.h>
13#include <net/netlink.h>
14#include <net/pkt_sched.h>
15#include <net/pkt_cls.h>
16
17#include <linux/tc_act/tc_skbmod.h>
18#include <net/tc_act/tc_skbmod.h>
19
20static unsigned int skbmod_net_id;
21static struct tc_action_ops act_skbmod_ops;
22
23#define MAX_EDIT_LEN ETH_HLEN
24static int tcf_skbmod_act(struct sk_buff *skb, const struct tc_action *a,
25 struct tcf_result *res)
26{
27 struct tcf_skbmod *d = to_skbmod(a);
28 int action;
29 struct tcf_skbmod_params *p;
30 u64 flags;
31 int err;
32
33 tcf_lastuse_update(&d->tcf_tm);
34 bstats_cpu_update(this_cpu_ptr(d->common.cpu_bstats), skb);
35
36 /* XXX: if you are going to edit more fields beyond ethernet header
37 * (example when you add IP header replacement or vlan swap)
38 * then MAX_EDIT_LEN needs to change appropriately
39 */
40 err = skb_ensure_writable(skb, MAX_EDIT_LEN);
41 if (unlikely(err)) /* best policy is to drop on the floor */
42 goto drop;
43
44 action = READ_ONCE(d->tcf_action);
45 if (unlikely(action == TC_ACT_SHOT))
46 goto drop;
47
48 p = rcu_dereference_bh(d->skbmod_p);
49 flags = p->flags;
50 if (flags & SKBMOD_F_DMAC)
51 ether_addr_copy(eth_hdr(skb)->h_dest, p->eth_dst);
52 if (flags & SKBMOD_F_SMAC)
53 ether_addr_copy(eth_hdr(skb)->h_source, p->eth_src);
54 if (flags & SKBMOD_F_ETYPE)
55 eth_hdr(skb)->h_proto = p->eth_type;
56
57 if (flags & SKBMOD_F_SWAPMAC) {
58 u16 tmpaddr[ETH_ALEN / 2]; /* ether_addr_copy() requirement */
59 /*XXX: I am sure we can come up with more efficient swapping*/
60 ether_addr_copy((u8 *)tmpaddr, eth_hdr(skb)->h_dest);
61 ether_addr_copy(eth_hdr(skb)->h_dest, eth_hdr(skb)->h_source);
62 ether_addr_copy(eth_hdr(skb)->h_source, (u8 *)tmpaddr);
63 }
64
65 return action;
66
67drop:
68 qstats_overlimit_inc(this_cpu_ptr(d->common.cpu_qstats));
69 return TC_ACT_SHOT;
70}
71
72static const struct nla_policy skbmod_policy[TCA_SKBMOD_MAX + 1] = {
73 [TCA_SKBMOD_PARMS] = { .len = sizeof(struct tc_skbmod) },
74 [TCA_SKBMOD_DMAC] = { .len = ETH_ALEN },
75 [TCA_SKBMOD_SMAC] = { .len = ETH_ALEN },
76 [TCA_SKBMOD_ETYPE] = { .type = NLA_U16 },
77};
78
79static int tcf_skbmod_init(struct net *net, struct nlattr *nla,
80 struct nlattr *est, struct tc_action **a,
81 int ovr, int bind, bool rtnl_held,
82 struct tcf_proto *tp,
83 struct netlink_ext_ack *extack)
84{
85 struct tc_action_net *tn = net_generic(net, skbmod_net_id);
86 struct nlattr *tb[TCA_SKBMOD_MAX + 1];
87 struct tcf_skbmod_params *p, *p_old;
88 struct tcf_chain *goto_ch = NULL;
89 struct tc_skbmod *parm;
90 u32 lflags = 0, index;
91 struct tcf_skbmod *d;
92 bool exists = false;
93 u8 *daddr = NULL;
94 u8 *saddr = NULL;
95 u16 eth_type = 0;
96 int ret = 0, err;
97
98 if (!nla)
99 return -EINVAL;
100
101 err = nla_parse_nested_deprecated(tb, TCA_SKBMOD_MAX, nla,
102 skbmod_policy, NULL);
103 if (err < 0)
104 return err;
105
106 if (!tb[TCA_SKBMOD_PARMS])
107 return -EINVAL;
108
109 if (tb[TCA_SKBMOD_DMAC]) {
110 daddr = nla_data(tb[TCA_SKBMOD_DMAC]);
111 lflags |= SKBMOD_F_DMAC;
112 }
113
114 if (tb[TCA_SKBMOD_SMAC]) {
115 saddr = nla_data(tb[TCA_SKBMOD_SMAC]);
116 lflags |= SKBMOD_F_SMAC;
117 }
118
119 if (tb[TCA_SKBMOD_ETYPE]) {
120 eth_type = nla_get_u16(tb[TCA_SKBMOD_ETYPE]);
121 lflags |= SKBMOD_F_ETYPE;
122 }
123
124 parm = nla_data(tb[TCA_SKBMOD_PARMS]);
125 index = parm->index;
126 if (parm->flags & SKBMOD_F_SWAPMAC)
127 lflags = SKBMOD_F_SWAPMAC;
128
129 err = tcf_idr_check_alloc(tn, &index, a, bind);
130 if (err < 0)
131 return err;
132 exists = err;
133 if (exists && bind)
134 return 0;
135
136 if (!lflags) {
137 if (exists)
138 tcf_idr_release(*a, bind);
139 else
140 tcf_idr_cleanup(tn, index);
141 return -EINVAL;
142 }
143
144 if (!exists) {
145 ret = tcf_idr_create(tn, index, est, a,
146 &act_skbmod_ops, bind, true);
147 if (ret) {
148 tcf_idr_cleanup(tn, index);
149 return ret;
150 }
151
152 ret = ACT_P_CREATED;
153 } else if (!ovr) {
154 tcf_idr_release(*a, bind);
155 return -EEXIST;
156 }
157 err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);
158 if (err < 0)
159 goto release_idr;
160
161 d = to_skbmod(*a);
162
163 p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL);
164 if (unlikely(!p)) {
165 err = -ENOMEM;
166 goto put_chain;
167 }
168
169 p->flags = lflags;
170
171 if (ovr)
172 spin_lock_bh(&d->tcf_lock);
173 /* Protected by tcf_lock if overwriting existing action. */
174 goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
175 p_old = rcu_dereference_protected(d->skbmod_p, 1);
176
177 if (lflags & SKBMOD_F_DMAC)
178 ether_addr_copy(p->eth_dst, daddr);
179 if (lflags & SKBMOD_F_SMAC)
180 ether_addr_copy(p->eth_src, saddr);
181 if (lflags & SKBMOD_F_ETYPE)
182 p->eth_type = htons(eth_type);
183
184 rcu_assign_pointer(d->skbmod_p, p);
185 if (ovr)
186 spin_unlock_bh(&d->tcf_lock);
187
188 if (p_old)
189 kfree_rcu(p_old, rcu);
190 if (goto_ch)
191 tcf_chain_put_by_act(goto_ch);
192
193 if (ret == ACT_P_CREATED)
194 tcf_idr_insert(tn, *a);
195 return ret;
196put_chain:
197 if (goto_ch)
198 tcf_chain_put_by_act(goto_ch);
199release_idr:
200 tcf_idr_release(*a, bind);
201 return err;
202}
203
204static void tcf_skbmod_cleanup(struct tc_action *a)
205{
206 struct tcf_skbmod *d = to_skbmod(a);
207 struct tcf_skbmod_params *p;
208
209 p = rcu_dereference_protected(d->skbmod_p, 1);
210 if (p)
211 kfree_rcu(p, rcu);
212}
213
214static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a,
215 int bind, int ref)
216{
217 struct tcf_skbmod *d = to_skbmod(a);
218 unsigned char *b = skb_tail_pointer(skb);
219 struct tcf_skbmod_params *p;
220 struct tc_skbmod opt = {
221 .index = d->tcf_index,
222 .refcnt = refcount_read(&d->tcf_refcnt) - ref,
223 .bindcnt = atomic_read(&d->tcf_bindcnt) - bind,
224 };
225 struct tcf_t t;
226
227 spin_lock_bh(&d->tcf_lock);
228 opt.action = d->tcf_action;
229 p = rcu_dereference_protected(d->skbmod_p,
230 lockdep_is_held(&d->tcf_lock));
231 opt.flags = p->flags;
232 if (nla_put(skb, TCA_SKBMOD_PARMS, sizeof(opt), &opt))
233 goto nla_put_failure;
234 if ((p->flags & SKBMOD_F_DMAC) &&
235 nla_put(skb, TCA_SKBMOD_DMAC, ETH_ALEN, p->eth_dst))
236 goto nla_put_failure;
237 if ((p->flags & SKBMOD_F_SMAC) &&
238 nla_put(skb, TCA_SKBMOD_SMAC, ETH_ALEN, p->eth_src))
239 goto nla_put_failure;
240 if ((p->flags & SKBMOD_F_ETYPE) &&
241 nla_put_u16(skb, TCA_SKBMOD_ETYPE, ntohs(p->eth_type)))
242 goto nla_put_failure;
243
244 tcf_tm_dump(&t, &d->tcf_tm);
245 if (nla_put_64bit(skb, TCA_SKBMOD_TM, sizeof(t), &t, TCA_SKBMOD_PAD))
246 goto nla_put_failure;
247
248 spin_unlock_bh(&d->tcf_lock);
249 return skb->len;
250nla_put_failure:
251 spin_unlock_bh(&d->tcf_lock);
252 nlmsg_trim(skb, b);
253 return -1;
254}
255
256static int tcf_skbmod_walker(struct net *net, struct sk_buff *skb,
257 struct netlink_callback *cb, int type,
258 const struct tc_action_ops *ops,
259 struct netlink_ext_ack *extack)
260{
261 struct tc_action_net *tn = net_generic(net, skbmod_net_id);
262
263 return tcf_generic_walker(tn, skb, cb, type, ops, extack);
264}
265
266static int tcf_skbmod_search(struct net *net, struct tc_action **a, u32 index)
267{
268 struct tc_action_net *tn = net_generic(net, skbmod_net_id);
269
270 return tcf_idr_search(tn, a, index);
271}
272
273static struct tc_action_ops act_skbmod_ops = {
274 .kind = "skbmod",
275 .id = TCA_ACT_SKBMOD,
276 .owner = THIS_MODULE,
277 .act = tcf_skbmod_act,
278 .dump = tcf_skbmod_dump,
279 .init = tcf_skbmod_init,
280 .cleanup = tcf_skbmod_cleanup,
281 .walk = tcf_skbmod_walker,
282 .lookup = tcf_skbmod_search,
283 .size = sizeof(struct tcf_skbmod),
284};
285
286static __net_init int skbmod_init_net(struct net *net)
287{
288 struct tc_action_net *tn = net_generic(net, skbmod_net_id);
289
290 return tc_action_net_init(net, tn, &act_skbmod_ops);
291}
292
293static void __net_exit skbmod_exit_net(struct list_head *net_list)
294{
295 tc_action_net_exit(net_list, skbmod_net_id);
296}
297
298static struct pernet_operations skbmod_net_ops = {
299 .init = skbmod_init_net,
300 .exit_batch = skbmod_exit_net,
301 .id = &skbmod_net_id,
302 .size = sizeof(struct tc_action_net),
303};
304
305MODULE_AUTHOR("Jamal Hadi Salim, <jhs@mojatatu.com>");
306MODULE_DESCRIPTION("SKB data mod-ing");
307MODULE_LICENSE("GPL");
308
309static int __init skbmod_init_module(void)
310{
311 return tcf_register_action(&act_skbmod_ops, &skbmod_net_ops);
312}
313
314static void __exit skbmod_cleanup_module(void)
315{
316 tcf_unregister_action(&act_skbmod_ops, &skbmod_net_ops);
317}
318
319module_init(skbmod_init_module);
320module_exit(skbmod_cleanup_module);
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * net/sched/act_skbmod.c skb data modifier
4 *
5 * Copyright (c) 2016 Jamal Hadi Salim <jhs@mojatatu.com>
6*/
7
8#include <linux/module.h>
9#include <linux/if_arp.h>
10#include <linux/init.h>
11#include <linux/kernel.h>
12#include <linux/skbuff.h>
13#include <linux/rtnetlink.h>
14#include <net/netlink.h>
15#include <net/pkt_sched.h>
16#include <net/pkt_cls.h>
17
18#include <linux/tc_act/tc_skbmod.h>
19#include <net/tc_act/tc_skbmod.h>
20
21static unsigned int skbmod_net_id;
22static struct tc_action_ops act_skbmod_ops;
23
24#define MAX_EDIT_LEN ETH_HLEN
25static int tcf_skbmod_act(struct sk_buff *skb, const struct tc_action *a,
26 struct tcf_result *res)
27{
28 struct tcf_skbmod *d = to_skbmod(a);
29 int action;
30 struct tcf_skbmod_params *p;
31 u64 flags;
32 int err;
33
34 tcf_lastuse_update(&d->tcf_tm);
35 bstats_cpu_update(this_cpu_ptr(d->common.cpu_bstats), skb);
36
37 action = READ_ONCE(d->tcf_action);
38 if (unlikely(action == TC_ACT_SHOT))
39 goto drop;
40
41 if (!skb->dev || skb->dev->type != ARPHRD_ETHER)
42 return action;
43
44 /* XXX: if you are going to edit more fields beyond ethernet header
45 * (example when you add IP header replacement or vlan swap)
46 * then MAX_EDIT_LEN needs to change appropriately
47 */
48 err = skb_ensure_writable(skb, MAX_EDIT_LEN);
49 if (unlikely(err)) /* best policy is to drop on the floor */
50 goto drop;
51
52 p = rcu_dereference_bh(d->skbmod_p);
53 flags = p->flags;
54 if (flags & SKBMOD_F_DMAC)
55 ether_addr_copy(eth_hdr(skb)->h_dest, p->eth_dst);
56 if (flags & SKBMOD_F_SMAC)
57 ether_addr_copy(eth_hdr(skb)->h_source, p->eth_src);
58 if (flags & SKBMOD_F_ETYPE)
59 eth_hdr(skb)->h_proto = p->eth_type;
60
61 if (flags & SKBMOD_F_SWAPMAC) {
62 u16 tmpaddr[ETH_ALEN / 2]; /* ether_addr_copy() requirement */
63 /*XXX: I am sure we can come up with more efficient swapping*/
64 ether_addr_copy((u8 *)tmpaddr, eth_hdr(skb)->h_dest);
65 ether_addr_copy(eth_hdr(skb)->h_dest, eth_hdr(skb)->h_source);
66 ether_addr_copy(eth_hdr(skb)->h_source, (u8 *)tmpaddr);
67 }
68
69 return action;
70
71drop:
72 qstats_overlimit_inc(this_cpu_ptr(d->common.cpu_qstats));
73 return TC_ACT_SHOT;
74}
75
76static const struct nla_policy skbmod_policy[TCA_SKBMOD_MAX + 1] = {
77 [TCA_SKBMOD_PARMS] = { .len = sizeof(struct tc_skbmod) },
78 [TCA_SKBMOD_DMAC] = { .len = ETH_ALEN },
79 [TCA_SKBMOD_SMAC] = { .len = ETH_ALEN },
80 [TCA_SKBMOD_ETYPE] = { .type = NLA_U16 },
81};
82
83static int tcf_skbmod_init(struct net *net, struct nlattr *nla,
84 struct nlattr *est, struct tc_action **a,
85 int ovr, int bind, bool rtnl_held,
86 struct tcf_proto *tp, u32 flags,
87 struct netlink_ext_ack *extack)
88{
89 struct tc_action_net *tn = net_generic(net, skbmod_net_id);
90 struct nlattr *tb[TCA_SKBMOD_MAX + 1];
91 struct tcf_skbmod_params *p, *p_old;
92 struct tcf_chain *goto_ch = NULL;
93 struct tc_skbmod *parm;
94 u32 lflags = 0, index;
95 struct tcf_skbmod *d;
96 bool exists = false;
97 u8 *daddr = NULL;
98 u8 *saddr = NULL;
99 u16 eth_type = 0;
100 int ret = 0, err;
101
102 if (!nla)
103 return -EINVAL;
104
105 err = nla_parse_nested_deprecated(tb, TCA_SKBMOD_MAX, nla,
106 skbmod_policy, NULL);
107 if (err < 0)
108 return err;
109
110 if (!tb[TCA_SKBMOD_PARMS])
111 return -EINVAL;
112
113 if (tb[TCA_SKBMOD_DMAC]) {
114 daddr = nla_data(tb[TCA_SKBMOD_DMAC]);
115 lflags |= SKBMOD_F_DMAC;
116 }
117
118 if (tb[TCA_SKBMOD_SMAC]) {
119 saddr = nla_data(tb[TCA_SKBMOD_SMAC]);
120 lflags |= SKBMOD_F_SMAC;
121 }
122
123 if (tb[TCA_SKBMOD_ETYPE]) {
124 eth_type = nla_get_u16(tb[TCA_SKBMOD_ETYPE]);
125 lflags |= SKBMOD_F_ETYPE;
126 }
127
128 parm = nla_data(tb[TCA_SKBMOD_PARMS]);
129 index = parm->index;
130 if (parm->flags & SKBMOD_F_SWAPMAC)
131 lflags = SKBMOD_F_SWAPMAC;
132
133 err = tcf_idr_check_alloc(tn, &index, a, bind);
134 if (err < 0)
135 return err;
136 exists = err;
137 if (exists && bind)
138 return 0;
139
140 if (!lflags) {
141 if (exists)
142 tcf_idr_release(*a, bind);
143 else
144 tcf_idr_cleanup(tn, index);
145 return -EINVAL;
146 }
147
148 if (!exists) {
149 ret = tcf_idr_create(tn, index, est, a,
150 &act_skbmod_ops, bind, true, 0);
151 if (ret) {
152 tcf_idr_cleanup(tn, index);
153 return ret;
154 }
155
156 ret = ACT_P_CREATED;
157 } else if (!ovr) {
158 tcf_idr_release(*a, bind);
159 return -EEXIST;
160 }
161 err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);
162 if (err < 0)
163 goto release_idr;
164
165 d = to_skbmod(*a);
166
167 p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL);
168 if (unlikely(!p)) {
169 err = -ENOMEM;
170 goto put_chain;
171 }
172
173 p->flags = lflags;
174
175 if (ovr)
176 spin_lock_bh(&d->tcf_lock);
177 /* Protected by tcf_lock if overwriting existing action. */
178 goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
179 p_old = rcu_dereference_protected(d->skbmod_p, 1);
180
181 if (lflags & SKBMOD_F_DMAC)
182 ether_addr_copy(p->eth_dst, daddr);
183 if (lflags & SKBMOD_F_SMAC)
184 ether_addr_copy(p->eth_src, saddr);
185 if (lflags & SKBMOD_F_ETYPE)
186 p->eth_type = htons(eth_type);
187
188 rcu_assign_pointer(d->skbmod_p, p);
189 if (ovr)
190 spin_unlock_bh(&d->tcf_lock);
191
192 if (p_old)
193 kfree_rcu(p_old, rcu);
194 if (goto_ch)
195 tcf_chain_put_by_act(goto_ch);
196
197 return ret;
198put_chain:
199 if (goto_ch)
200 tcf_chain_put_by_act(goto_ch);
201release_idr:
202 tcf_idr_release(*a, bind);
203 return err;
204}
205
206static void tcf_skbmod_cleanup(struct tc_action *a)
207{
208 struct tcf_skbmod *d = to_skbmod(a);
209 struct tcf_skbmod_params *p;
210
211 p = rcu_dereference_protected(d->skbmod_p, 1);
212 if (p)
213 kfree_rcu(p, rcu);
214}
215
216static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a,
217 int bind, int ref)
218{
219 struct tcf_skbmod *d = to_skbmod(a);
220 unsigned char *b = skb_tail_pointer(skb);
221 struct tcf_skbmod_params *p;
222 struct tc_skbmod opt = {
223 .index = d->tcf_index,
224 .refcnt = refcount_read(&d->tcf_refcnt) - ref,
225 .bindcnt = atomic_read(&d->tcf_bindcnt) - bind,
226 };
227 struct tcf_t t;
228
229 spin_lock_bh(&d->tcf_lock);
230 opt.action = d->tcf_action;
231 p = rcu_dereference_protected(d->skbmod_p,
232 lockdep_is_held(&d->tcf_lock));
233 opt.flags = p->flags;
234 if (nla_put(skb, TCA_SKBMOD_PARMS, sizeof(opt), &opt))
235 goto nla_put_failure;
236 if ((p->flags & SKBMOD_F_DMAC) &&
237 nla_put(skb, TCA_SKBMOD_DMAC, ETH_ALEN, p->eth_dst))
238 goto nla_put_failure;
239 if ((p->flags & SKBMOD_F_SMAC) &&
240 nla_put(skb, TCA_SKBMOD_SMAC, ETH_ALEN, p->eth_src))
241 goto nla_put_failure;
242 if ((p->flags & SKBMOD_F_ETYPE) &&
243 nla_put_u16(skb, TCA_SKBMOD_ETYPE, ntohs(p->eth_type)))
244 goto nla_put_failure;
245
246 tcf_tm_dump(&t, &d->tcf_tm);
247 if (nla_put_64bit(skb, TCA_SKBMOD_TM, sizeof(t), &t, TCA_SKBMOD_PAD))
248 goto nla_put_failure;
249
250 spin_unlock_bh(&d->tcf_lock);
251 return skb->len;
252nla_put_failure:
253 spin_unlock_bh(&d->tcf_lock);
254 nlmsg_trim(skb, b);
255 return -1;
256}
257
258static int tcf_skbmod_walker(struct net *net, struct sk_buff *skb,
259 struct netlink_callback *cb, int type,
260 const struct tc_action_ops *ops,
261 struct netlink_ext_ack *extack)
262{
263 struct tc_action_net *tn = net_generic(net, skbmod_net_id);
264
265 return tcf_generic_walker(tn, skb, cb, type, ops, extack);
266}
267
268static int tcf_skbmod_search(struct net *net, struct tc_action **a, u32 index)
269{
270 struct tc_action_net *tn = net_generic(net, skbmod_net_id);
271
272 return tcf_idr_search(tn, a, index);
273}
274
275static struct tc_action_ops act_skbmod_ops = {
276 .kind = "skbmod",
277 .id = TCA_ACT_SKBMOD,
278 .owner = THIS_MODULE,
279 .act = tcf_skbmod_act,
280 .dump = tcf_skbmod_dump,
281 .init = tcf_skbmod_init,
282 .cleanup = tcf_skbmod_cleanup,
283 .walk = tcf_skbmod_walker,
284 .lookup = tcf_skbmod_search,
285 .size = sizeof(struct tcf_skbmod),
286};
287
288static __net_init int skbmod_init_net(struct net *net)
289{
290 struct tc_action_net *tn = net_generic(net, skbmod_net_id);
291
292 return tc_action_net_init(net, tn, &act_skbmod_ops);
293}
294
295static void __net_exit skbmod_exit_net(struct list_head *net_list)
296{
297 tc_action_net_exit(net_list, skbmod_net_id);
298}
299
300static struct pernet_operations skbmod_net_ops = {
301 .init = skbmod_init_net,
302 .exit_batch = skbmod_exit_net,
303 .id = &skbmod_net_id,
304 .size = sizeof(struct tc_action_net),
305};
306
307MODULE_AUTHOR("Jamal Hadi Salim, <jhs@mojatatu.com>");
308MODULE_DESCRIPTION("SKB data mod-ing");
309MODULE_LICENSE("GPL");
310
311static int __init skbmod_init_module(void)
312{
313 return tcf_register_action(&act_skbmod_ops, &skbmod_net_ops);
314}
315
316static void __exit skbmod_cleanup_module(void)
317{
318 tcf_unregister_action(&act_skbmod_ops, &skbmod_net_ops);
319}
320
321module_init(skbmod_init_module);
322module_exit(skbmod_cleanup_module);