blob: 4f0ed8780194502465f0d5b60383bf6794bfadf0 [file] [log] [blame]
Sergey Lapin9ec76712009-06-08 12:18:48 +00001/*
Dmitry Eremin-Solenikov5fd72602010-10-22 01:25:25 +04002 * IEEE 802.15.4 dgram socket interface
Sergey Lapin9ec76712009-06-08 12:18:48 +00003 *
4 * Copyright 2007, 2008 Siemens AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Written by:
20 * Sergey Lapin <slapin@ossfans.org>
21 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
22 */
23
Phoebe Buckheisteraf9eed52014-05-16 17:46:41 +020024#include <linux/capability.h>
Sergey Lapin9ec76712009-06-08 12:18:48 +000025#include <linux/net.h>
26#include <linux/module.h>
27#include <linux/if_arp.h>
28#include <linux/list.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090029#include <linux/slab.h>
Sergey Lapin9ec76712009-06-08 12:18:48 +000030#include <net/sock.h>
Dmitry Eremin-Solenikovf0166e52009-07-23 16:56:29 +040031#include <net/af_ieee802154.h>
32#include <net/ieee802154.h>
33#include <net/ieee802154_netdev.h>
Sergey Lapin9ec76712009-06-08 12:18:48 +000034
35#include <asm/ioctls.h>
36
37#include "af802154.h"
38
39static HLIST_HEAD(dgram_head);
40static DEFINE_RWLOCK(dgram_lock);
41
42struct dgram_sock {
43 struct sock sk;
44
Phoebe Buckheistere6278d92014-03-14 21:24:01 +010045 struct ieee802154_addr src_addr;
46 struct ieee802154_addr dst_addr;
Dmitry Baryshkov74eda552009-08-07 02:58:42 +000047
Eric Dumazet95c96172012-04-15 05:58:06 +000048 unsigned int bound:1;
Phoebe Buckheister1cc76e32014-05-14 17:43:10 +020049 unsigned int connected:1;
Eric Dumazet95c96172012-04-15 05:58:06 +000050 unsigned int want_ack:1;
Phoebe Buckheisteraf9eed52014-05-16 17:46:41 +020051 unsigned int secen:1;
52 unsigned int secen_override:1;
53 unsigned int seclevel:3;
54 unsigned int seclevel_override:1;
Sergey Lapin9ec76712009-06-08 12:18:48 +000055};
56
57static inline struct dgram_sock *dgram_sk(const struct sock *sk)
58{
59 return container_of(sk, struct dgram_sock, sk);
60}
61
Sergey Lapin9ec76712009-06-08 12:18:48 +000062static void dgram_hash(struct sock *sk)
63{
64 write_lock_bh(&dgram_lock);
65 sk_add_node(sk, &dgram_head);
66 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
67 write_unlock_bh(&dgram_lock);
68}
69
70static void dgram_unhash(struct sock *sk)
71{
72 write_lock_bh(&dgram_lock);
73 if (sk_del_node_init(sk))
74 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
75 write_unlock_bh(&dgram_lock);
76}
77
78static int dgram_init(struct sock *sk)
79{
80 struct dgram_sock *ro = dgram_sk(sk);
81
Dmitry Baryshkov99eb8552009-08-07 02:58:43 +000082 ro->want_ack = 1;
Sergey Lapin9ec76712009-06-08 12:18:48 +000083 return 0;
84}
85
86static void dgram_close(struct sock *sk, long timeout)
87{
88 sk_common_release(sk);
89}
90
91static int dgram_bind(struct sock *sk, struct sockaddr *uaddr, int len)
92{
93 struct sockaddr_ieee802154 *addr = (struct sockaddr_ieee802154 *)uaddr;
Phoebe Buckheistere6278d92014-03-14 21:24:01 +010094 struct ieee802154_addr haddr;
Sergey Lapin9ec76712009-06-08 12:18:48 +000095 struct dgram_sock *ro = dgram_sk(sk);
Dmitry Baryshkov74eda552009-08-07 02:58:42 +000096 int err = -EINVAL;
Sergey Lapin9ec76712009-06-08 12:18:48 +000097 struct net_device *dev;
98
Dmitry Baryshkov74eda552009-08-07 02:58:42 +000099 lock_sock(sk);
100
Sergey Lapin9ec76712009-06-08 12:18:48 +0000101 ro->bound = 0;
102
103 if (len < sizeof(*addr))
Dmitry Baryshkov74eda552009-08-07 02:58:42 +0000104 goto out;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000105
106 if (addr->family != AF_IEEE802154)
Dmitry Baryshkov74eda552009-08-07 02:58:42 +0000107 goto out;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000108
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100109 ieee802154_addr_from_sa(&haddr, &addr->addr);
110 dev = ieee802154_get_dev(sock_net(sk), &haddr);
Sergey Lapin9ec76712009-06-08 12:18:48 +0000111 if (!dev) {
112 err = -ENODEV;
113 goto out;
114 }
115
116 if (dev->type != ARPHRD_IEEE802154) {
117 err = -ENODEV;
118 goto out_put;
119 }
120
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100121 ro->src_addr = haddr;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000122
123 ro->bound = 1;
Dmitry Baryshkov74eda552009-08-07 02:58:42 +0000124 err = 0;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000125out_put:
126 dev_put(dev);
127out:
128 release_sock(sk);
129
130 return err;
131}
132
133static int dgram_ioctl(struct sock *sk, int cmd, unsigned long arg)
134{
135 switch (cmd) {
136 case SIOCOUTQ:
137 {
Eric Dumazet31e6d362009-06-17 19:05:41 -0700138 int amount = sk_wmem_alloc_get(sk);
139
Sergey Lapin9ec76712009-06-08 12:18:48 +0000140 return put_user(amount, (int __user *)arg);
141 }
142
143 case SIOCINQ:
144 {
145 struct sk_buff *skb;
146 unsigned long amount;
147
148 amount = 0;
149 spin_lock_bh(&sk->sk_receive_queue.lock);
150 skb = skb_peek(&sk->sk_receive_queue);
151 if (skb != NULL) {
152 /*
153 * We will only return the amount
154 * of this packet since that is all
155 * that will be read.
156 */
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100157 amount = skb->len - ieee802154_hdr_length(skb);
Sergey Lapin9ec76712009-06-08 12:18:48 +0000158 }
159 spin_unlock_bh(&sk->sk_receive_queue.lock);
160 return put_user(amount, (int __user *)arg);
161 }
162
163 }
164 return -ENOIOCTLCMD;
165}
166
167/* FIXME: autobind */
168static int dgram_connect(struct sock *sk, struct sockaddr *uaddr,
169 int len)
170{
171 struct sockaddr_ieee802154 *addr = (struct sockaddr_ieee802154 *)uaddr;
172 struct dgram_sock *ro = dgram_sk(sk);
173 int err = 0;
174
175 if (len < sizeof(*addr))
176 return -EINVAL;
177
178 if (addr->family != AF_IEEE802154)
179 return -EINVAL;
180
181 lock_sock(sk);
182
183 if (!ro->bound) {
184 err = -ENETUNREACH;
185 goto out;
186 }
187
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100188 ieee802154_addr_from_sa(&ro->dst_addr, &addr->addr);
Phoebe Buckheister1cc76e32014-05-14 17:43:10 +0200189 ro->connected = 1;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000190
191out:
192 release_sock(sk);
193 return err;
194}
195
196static int dgram_disconnect(struct sock *sk, int flags)
197{
198 struct dgram_sock *ro = dgram_sk(sk);
199
200 lock_sock(sk);
Phoebe Buckheister1cc76e32014-05-14 17:43:10 +0200201 ro->connected = 0;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000202 release_sock(sk);
203
204 return 0;
205}
206
207static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk,
208 struct msghdr *msg, size_t size)
209{
210 struct net_device *dev;
Eric Dumazet95c96172012-04-15 05:58:06 +0000211 unsigned int mtu;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000212 struct sk_buff *skb;
Phoebe Buckheister32edc402014-05-14 17:43:08 +0200213 struct ieee802154_mac_cb *cb;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000214 struct dgram_sock *ro = dgram_sk(sk);
Phoebe Buckheister1cc76e32014-05-14 17:43:10 +0200215 struct ieee802154_addr dst_addr;
Herbert Xuae641942011-11-18 02:20:04 +0000216 int hlen, tlen;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000217 int err;
218
219 if (msg->msg_flags & MSG_OOB) {
220 pr_debug("msg->msg_flags = 0x%x\n", msg->msg_flags);
221 return -EOPNOTSUPP;
222 }
223
Phoebe Buckheister1cc76e32014-05-14 17:43:10 +0200224 if (!ro->connected && !msg->msg_name)
225 return -EDESTADDRREQ;
226 else if (ro->connected && msg->msg_name)
227 return -EISCONN;
228
Sergey Lapin9ec76712009-06-08 12:18:48 +0000229 if (!ro->bound)
230 dev = dev_getfirstbyhwtype(sock_net(sk), ARPHRD_IEEE802154);
231 else
232 dev = ieee802154_get_dev(sock_net(sk), &ro->src_addr);
233
234 if (!dev) {
235 pr_debug("no dev\n");
236 err = -ENXIO;
237 goto out;
238 }
239 mtu = dev->mtu;
240 pr_debug("name = %s, mtu = %u\n", dev->name, mtu);
241
Sasha Levin3da947b2012-07-02 01:29:55 +0000242 if (size > mtu) {
243 pr_debug("size = %Zu, mtu = %u\n", size, mtu);
Phoebe Buckheisterd1d73582014-03-14 21:24:04 +0100244 err = -EMSGSIZE;
Sasha Levin3da947b2012-07-02 01:29:55 +0000245 goto out_dev;
246 }
247
Herbert Xuae641942011-11-18 02:20:04 +0000248 hlen = LL_RESERVED_SPACE(dev);
249 tlen = dev->needed_tailroom;
250 skb = sock_alloc_send_skb(sk, hlen + tlen + size,
Sergey Lapin9ec76712009-06-08 12:18:48 +0000251 msg->msg_flags & MSG_DONTWAIT,
252 &err);
253 if (!skb)
254 goto out_dev;
255
Herbert Xuae641942011-11-18 02:20:04 +0000256 skb_reserve(skb, hlen);
Sergey Lapin9ec76712009-06-08 12:18:48 +0000257
258 skb_reset_network_header(skb);
259
Phoebe Buckheister32edc402014-05-14 17:43:08 +0200260 cb = mac_cb_init(skb);
261 cb->type = IEEE802154_FC_TYPE_DATA;
262 cb->ackreq = ro->want_ack;
Dmitry Baryshkov99eb8552009-08-07 02:58:43 +0000263
Phoebe Buckheister1cc76e32014-05-14 17:43:10 +0200264 if (msg->msg_name) {
265 DECLARE_SOCKADDR(struct sockaddr_ieee802154*, daddr, msg->msg_name);
266
267 ieee802154_addr_from_sa(&dst_addr, &daddr->addr);
268 } else {
269 dst_addr = ro->dst_addr;
270 }
271
Phoebe Buckheisteraf9eed52014-05-16 17:46:41 +0200272 cb->secen = ro->secen;
273 cb->secen_override = ro->secen_override;
274 cb->seclevel = ro->seclevel;
275 cb->seclevel_override = ro->seclevel_override;
276
Phoebe Buckheister1cc76e32014-05-14 17:43:10 +0200277 err = dev_hard_header(skb, dev, ETH_P_IEEE802154, &dst_addr,
278 ro->bound ? &ro->src_addr : NULL, size);
Sergey Lapin9ec76712009-06-08 12:18:48 +0000279 if (err < 0)
280 goto out_skb;
281
Sergey Lapin9ec76712009-06-08 12:18:48 +0000282 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
283 if (err < 0)
284 goto out_skb;
285
Sergey Lapin9ec76712009-06-08 12:18:48 +0000286 skb->dev = dev;
287 skb->sk = sk;
288 skb->protocol = htons(ETH_P_IEEE802154);
289
290 dev_put(dev);
291
292 err = dev_queue_xmit(skb);
293 if (err > 0)
294 err = net_xmit_errno(err);
295
296 return err ?: size;
297
298out_skb:
299 kfree_skb(skb);
300out_dev:
301 dev_put(dev);
302out:
303 return err;
304}
305
306static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk,
307 struct msghdr *msg, size_t len, int noblock, int flags,
308 int *addr_len)
309{
310 size_t copied = 0;
311 int err = -EOPNOTSUPP;
312 struct sk_buff *skb;
Steffen Hurrle342dfc32014-01-17 22:53:15 +0100313 DECLARE_SOCKADDR(struct sockaddr_ieee802154 *, saddr, msg->msg_name);
Sergey Lapin9ec76712009-06-08 12:18:48 +0000314
315 skb = skb_recv_datagram(sk, flags, noblock, &err);
316 if (!skb)
317 goto out;
318
319 copied = skb->len;
320 if (len < copied) {
321 msg->msg_flags |= MSG_TRUNC;
322 copied = len;
323 }
324
325 /* FIXME: skip headers if necessary ?! */
326 err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
327 if (err)
328 goto done;
329
Neil Horman3b885782009-10-12 13:26:31 -0700330 sock_recv_ts_and_drops(msg, sk, skb);
Sergey Lapin9ec76712009-06-08 12:18:48 +0000331
Stephen Röttger6364e6e2013-03-26 12:41:29 +0000332 if (saddr) {
333 saddr->family = AF_IEEE802154;
Phoebe Buckheisterae531b92014-03-14 21:24:02 +0100334 ieee802154_addr_to_sa(&saddr->addr, &mac_cb(skb)->source);
Stephen Röttger6364e6e2013-03-26 12:41:29 +0000335 *addr_len = sizeof(*saddr);
Hannes Frederic Sowabceaa902013-11-18 04:20:45 +0100336 }
Stephen Röttger6364e6e2013-03-26 12:41:29 +0000337
Sergey Lapin9ec76712009-06-08 12:18:48 +0000338 if (flags & MSG_TRUNC)
339 copied = skb->len;
340done:
341 skb_free_datagram(sk, skb);
342out:
343 if (err)
344 return err;
345 return copied;
346}
347
348static int dgram_rcv_skb(struct sock *sk, struct sk_buff *skb)
349{
Phoebe Buckheister8cfad492014-03-17 18:30:19 +0100350 skb = skb_share_check(skb, GFP_ATOMIC);
351 if (!skb)
352 return NET_RX_DROP;
353
Sergey Lapin9ec76712009-06-08 12:18:48 +0000354 if (sock_queue_rcv_skb(sk, skb) < 0) {
Sergey Lapin9ec76712009-06-08 12:18:48 +0000355 kfree_skb(skb);
356 return NET_RX_DROP;
357 }
358
359 return NET_RX_SUCCESS;
360}
361
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100362static inline bool
363ieee802154_match_sock(__le64 hw_addr, __le16 pan_id, __le16 short_addr,
364 struct dgram_sock *ro)
Sergey Lapin9ec76712009-06-08 12:18:48 +0000365{
366 if (!ro->bound)
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100367 return true;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000368
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100369 if (ro->src_addr.mode == IEEE802154_ADDR_LONG &&
370 hw_addr == ro->src_addr.extended_addr)
371 return true;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000372
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100373 if (ro->src_addr.mode == IEEE802154_ADDR_SHORT &&
374 pan_id == ro->src_addr.pan_id &&
375 short_addr == ro->src_addr.short_addr)
376 return true;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000377
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100378 return false;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000379}
380
381int ieee802154_dgram_deliver(struct net_device *dev, struct sk_buff *skb)
382{
383 struct sock *sk, *prev = NULL;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000384 int ret = NET_RX_SUCCESS;
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100385 __le16 pan_id, short_addr;
386 __le64 hw_addr;
Sergey Lapin9ec76712009-06-08 12:18:48 +0000387
388 /* Data frame processing */
389 BUG_ON(dev->type != ARPHRD_IEEE802154);
390
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100391 pan_id = ieee802154_mlme_ops(dev)->get_pan_id(dev);
392 short_addr = ieee802154_mlme_ops(dev)->get_short_addr(dev);
393 hw_addr = ieee802154_devaddr_from_raw(dev->dev_addr);
Sergey Lapin9ec76712009-06-08 12:18:48 +0000394
395 read_lock(&dgram_lock);
Sasha Levinb67bfe02013-02-27 17:06:00 -0800396 sk_for_each(sk, &dgram_head) {
Phoebe Buckheistere6278d92014-03-14 21:24:01 +0100397 if (ieee802154_match_sock(hw_addr, pan_id, short_addr,
398 dgram_sk(sk))) {
Sergey Lapin9ec76712009-06-08 12:18:48 +0000399 if (prev) {
400 struct sk_buff *clone;
401 clone = skb_clone(skb, GFP_ATOMIC);
402 if (clone)
403 dgram_rcv_skb(prev, clone);
404 }
405
406 prev = sk;
407 }
408 }
409
410 if (prev)
411 dgram_rcv_skb(prev, skb);
412 else {
413 kfree_skb(skb);
414 ret = NET_RX_DROP;
415 }
416 read_unlock(&dgram_lock);
417
418 return ret;
419}
420
Dmitry Eremin-Solenikova9dfac32009-08-03 17:53:00 +0400421static int dgram_getsockopt(struct sock *sk, int level, int optname,
422 char __user *optval, int __user *optlen)
423{
Dmitry Baryshkov99eb8552009-08-07 02:58:43 +0000424 struct dgram_sock *ro = dgram_sk(sk);
425
426 int val, len;
427
428 if (level != SOL_IEEE802154)
429 return -EOPNOTSUPP;
430
431 if (get_user(len, optlen))
432 return -EFAULT;
433
434 len = min_t(unsigned int, len, sizeof(int));
435
436 switch (optname) {
437 case WPAN_WANTACK:
438 val = ro->want_ack;
439 break;
Phoebe Buckheisteraf9eed52014-05-16 17:46:41 +0200440 case WPAN_SECURITY:
441 if (!ro->secen_override)
442 val = WPAN_SECURITY_DEFAULT;
443 else if (ro->secen)
444 val = WPAN_SECURITY_ON;
445 else
446 val = WPAN_SECURITY_OFF;
447 break;
448 case WPAN_SECURITY_LEVEL:
449 if (!ro->seclevel_override)
450 val = WPAN_SECURITY_LEVEL_DEFAULT;
451 else
452 val = ro->seclevel;
453 break;
Dmitry Baryshkov99eb8552009-08-07 02:58:43 +0000454 default:
455 return -ENOPROTOOPT;
456 }
457
458 if (put_user(len, optlen))
459 return -EFAULT;
460 if (copy_to_user(optval, &val, len))
461 return -EFAULT;
462 return 0;
Dmitry Eremin-Solenikova9dfac32009-08-03 17:53:00 +0400463}
464
465static int dgram_setsockopt(struct sock *sk, int level, int optname,
David S. Millerb7058842009-09-30 16:12:20 -0700466 char __user *optval, unsigned int optlen)
Dmitry Eremin-Solenikova9dfac32009-08-03 17:53:00 +0400467{
Dmitry Baryshkov99eb8552009-08-07 02:58:43 +0000468 struct dgram_sock *ro = dgram_sk(sk);
Phoebe Buckheisteraf9eed52014-05-16 17:46:41 +0200469 struct net *net = sock_net(sk);
Dmitry Baryshkov99eb8552009-08-07 02:58:43 +0000470 int val;
471 int err = 0;
472
473 if (optlen < sizeof(int))
474 return -EINVAL;
475
476 if (get_user(val, (int __user *)optval))
477 return -EFAULT;
478
479 lock_sock(sk);
480
481 switch (optname) {
482 case WPAN_WANTACK:
483 ro->want_ack = !!val;
484 break;
Phoebe Buckheisteraf9eed52014-05-16 17:46:41 +0200485 case WPAN_SECURITY:
486 if (!ns_capable(net->user_ns, CAP_NET_ADMIN) &&
487 !ns_capable(net->user_ns, CAP_NET_RAW)) {
488 err = -EPERM;
489 break;
490 }
491
492 switch (val) {
493 case WPAN_SECURITY_DEFAULT:
494 ro->secen_override = 0;
495 break;
496 case WPAN_SECURITY_ON:
497 ro->secen_override = 1;
498 ro->secen = 1;
499 break;
500 case WPAN_SECURITY_OFF:
501 ro->secen_override = 1;
502 ro->secen = 0;
503 break;
504 default:
505 err = -EINVAL;
506 break;
507 }
508 break;
509 case WPAN_SECURITY_LEVEL:
510 if (!ns_capable(net->user_ns, CAP_NET_ADMIN) &&
511 !ns_capable(net->user_ns, CAP_NET_RAW)) {
512 err = -EPERM;
513 break;
514 }
515
516 if (val < WPAN_SECURITY_LEVEL_DEFAULT ||
517 val > IEEE802154_SCF_SECLEVEL_ENC_MIC128) {
518 err = -EINVAL;
519 } else if (val == WPAN_SECURITY_LEVEL_DEFAULT) {
520 ro->seclevel_override = 0;
521 } else {
522 ro->seclevel_override = 1;
523 ro->seclevel = val;
524 }
525 break;
Dmitry Baryshkov99eb8552009-08-07 02:58:43 +0000526 default:
527 err = -ENOPROTOOPT;
528 break;
529 }
530
531 release_sock(sk);
532 return err;
Dmitry Eremin-Solenikova9dfac32009-08-03 17:53:00 +0400533}
534
Sergey Lapin9ec76712009-06-08 12:18:48 +0000535struct proto ieee802154_dgram_prot = {
536 .name = "IEEE-802.15.4-MAC",
537 .owner = THIS_MODULE,
538 .obj_size = sizeof(struct dgram_sock),
539 .init = dgram_init,
540 .close = dgram_close,
541 .bind = dgram_bind,
542 .sendmsg = dgram_sendmsg,
543 .recvmsg = dgram_recvmsg,
544 .hash = dgram_hash,
545 .unhash = dgram_unhash,
546 .connect = dgram_connect,
547 .disconnect = dgram_disconnect,
548 .ioctl = dgram_ioctl,
Dmitry Eremin-Solenikova9dfac32009-08-03 17:53:00 +0400549 .getsockopt = dgram_getsockopt,
550 .setsockopt = dgram_setsockopt,
Sergey Lapin9ec76712009-06-08 12:18:48 +0000551};
552