2 This file is part of GNUnet.
3 (C) 2010, 2011 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file src/transport/gnunet-transport-wlan-helper.c
23 * @brief wlan layer two server; must run as root (SUID will do)
24 * This code will work under GNU/Linux only.
25 * @author David Brodski
27 * This program serves as the mediator between the wlan interface and
32 #include <sys/socket.h>
33 #include <sys/ioctl.h>
34 #include <sys/types.h>
39 #include <netpacket/packet.h>
40 #include <linux/if_ether.h>
42 #include <linux/wireless.h>
43 #include <netinet/in.h>
44 #include <linux/if_tun.h>
52 //#include <sys/utsname.h>
53 #include <sys/param.h>
61 //#include "platform.h"
62 #include "gnunet_constants.h"
63 #include "gnunet_os_lib.h"
64 #include "gnunet_transport_plugin.h"
65 #include "transport.h"
66 #include "gnunet_util_lib.h"
67 #include "plugin_transport_wlan.h"
68 #include "gnunet_common.h"
69 #include "gnunet-transport-wlan-helper.h"
70 #include "gnunet_crypto_lib.h"
72 #include "wlan/radiotap-parser.h"
73 /* radiotap-parser defines types like u8 that
74 * ieee80211_radiotap.h needs
76 * we use our local copy of ieee80211_radiotap.h
78 * - since we can't support extensions we don't understand
79 * - since linux does not include it in userspace headers
81 #include "wlan/ieee80211_radiotap.h"
82 #include "wlan/crctable_osdep.h"
83 #include "wlan/loopback_helper.h"
84 #include "wlan/ieee80211.h"
86 #define ARPHRD_IEEE80211 801
87 #define ARPHRD_IEEE80211_PRISM 802
88 #define ARPHRD_IEEE80211_FULL 803
90 #include "wlan/loopback_helper.h"
94 #define MAC_ADDR_SIZE 6
99 struct sendbuf write_pout;
104 * Name of the interface, not necessarily 0-terminated (!).
106 char iface[IFNAMSIZ];
107 unsigned char pl_mac[MAC_ADDR_SIZE];
111 int getChannelFromFrequency(int frequency);
113 // FIXME: make nice...
115 calc_crc_osdep(unsigned char * buf, int len)
117 unsigned long crc = 0xFFFFFFFF;
119 for (; len > 0; len--, buf++)
120 crc = crc_tbl_osdep[(crc ^ *buf) & 0xFF] ^ (crc >> 8);
125 /* CRC checksum verification routine */
127 // FIXME: make nice...
129 check_crc_buf_osdep(unsigned char *buf, int len)
136 crc = calc_crc_osdep(buf, len);
138 return (((crc) & 0xFF) == buf[0] && ((crc >> 8) & 0xFF) == buf[1] && ((crc
139 >> 16) & 0xFF) == buf[2] && ((crc >> 24) & 0xFF) == buf[3]);
143 // FIXME: make nice...
145 linux_get_channel(struct Hardware_Infos *dev)
151 memset(&wrq, 0, sizeof(struct iwreq));
153 strncpy(wrq.ifr_name, dev->iface, IFNAMSIZ );
156 if (0 > ioctl(fd, SIOCGIWFREQ, &wrq))
159 frequency = wrq.u.freq.m;
160 if (100000000 < frequency )
162 else if (1000000 < frequency )
165 if (1000 < frequency)
166 chan = getChannelFromFrequency(frequency);
174 // FIXME: make nice...
176 linux_read (struct Hardware_Infos *dev,
177 unsigned char *buf, /* FIXME: void*? */
179 struct Radiotap_rx *ri)
181 unsigned char tmpbuf[buf_size];
183 int n, got_signal, got_noise, got_channel, fcs_removed;
185 n = got_signal = got_noise = got_channel = fcs_removed = 0;
187 caplen = read(dev->fd_raw, tmpbuf, buf_size);
193 "Failed to read from RAW socket: %s\n",
198 memset(buf, 0, buf_size);
199 memset(ri, 0, sizeof(*ri));
201 switch (dev->arptype_in)
203 case ARPHRD_IEEE80211_PRISM:
205 /* skip the prism header */
206 if (tmpbuf[7] == 0x40)
208 /* prism54 uses a different format */
209 ri->ri_power = tmpbuf[0x33];
210 ri->ri_noise = *(unsigned int *) (tmpbuf + 0x33 + 12);
211 ri->ri_rate = (*(unsigned int *) (tmpbuf + 0x33 + 24)) * 500000;
218 ri->ri_mactime = *(u_int64_t*) (tmpbuf + 0x5C - 48);
219 ri->ri_channel = *(unsigned int *) (tmpbuf + 0x5C - 36);
220 ri->ri_power = *(unsigned int *) (tmpbuf + 0x5C);
221 ri->ri_noise = *(unsigned int *) (tmpbuf + 0x5C + 12);
222 ri->ri_rate = (*(unsigned int *) (tmpbuf + 0x5C + 24)) * 500000;
226 n = *(int *) (tmpbuf + 4);
229 if (n < 8 || n >= caplen)
234 case ARPHRD_IEEE80211_FULL:
236 struct ieee80211_radiotap_iterator iterator;
237 struct ieee80211_radiotap_header *rthdr;
239 rthdr = (struct ieee80211_radiotap_header *) tmpbuf;
241 if (ieee80211_radiotap_iterator_init(&iterator, rthdr, caplen) < 0)
244 /* go through the radiotap arguments we have been given
248 while (ieee80211_radiotap_iterator_next(&iterator) >= 0)
251 switch (iterator.this_arg_index)
254 case IEEE80211_RADIOTAP_TSFT:
255 ri->ri_mactime = le64_to_cpu(*((uint64_t*) iterator.this_arg));
258 case IEEE80211_RADIOTAP_DBM_ANTSIGNAL:
261 if (*iterator.this_arg < 127)
262 ri->ri_power = *iterator.this_arg;
264 ri->ri_power = *iterator.this_arg - 255;
270 case IEEE80211_RADIOTAP_DB_ANTSIGNAL:
273 if (*iterator.this_arg < 127)
274 ri->ri_power = *iterator.this_arg;
276 ri->ri_power = *iterator.this_arg - 255;
282 case IEEE80211_RADIOTAP_DBM_ANTNOISE:
285 if (*iterator.this_arg < 127)
286 ri->ri_noise = *iterator.this_arg;
288 ri->ri_noise = *iterator.this_arg - 255;
294 case IEEE80211_RADIOTAP_DB_ANTNOISE:
297 if (*iterator.this_arg < 127)
298 ri->ri_noise = *iterator.this_arg;
300 ri->ri_noise = *iterator.this_arg - 255;
306 case IEEE80211_RADIOTAP_ANTENNA:
307 ri->ri_antenna = *iterator.this_arg;
310 case IEEE80211_RADIOTAP_CHANNEL:
311 ri->ri_channel = *iterator.this_arg;
315 case IEEE80211_RADIOTAP_RATE:
316 ri->ri_rate = (*iterator.this_arg) * 500000;
319 case IEEE80211_RADIOTAP_FLAGS:
320 /* is the CRC visible at the end?
323 if (*iterator.this_arg & IEEE80211_RADIOTAP_F_FCS)
329 if (*iterator.this_arg & IEEE80211_RADIOTAP_F_RX_BADFCS)
335 n = le16_to_cpu(rthdr->it_len);
336 if (n <= 0 || n >= caplen)
340 case ARPHRD_IEEE80211:
350 //detect fcs at the end, even if the flag wasn't set and remove it
351 if ( (0 == fcs_removed) &&
352 (1 == check_crc_buf_osdep(tmpbuf + n, caplen - 4)) )
356 memcpy(buf, tmpbuf + n, caplen);
358 ri->ri_channel = linux_get_channel(dev);
365 * @return 0 on success
368 openraw (struct Hardware_Infos *dev)
372 struct packet_mreq mr;
373 struct sockaddr_ll sll;
375 /* find the interface index */
376 memset(&ifr, 0, sizeof(ifr));
377 strncpy(ifr.ifr_name, dev->iface, IFNAMSIZ);
378 if (-1 == ioctl(dev->fd_raw, SIOCGIFINDEX, &ifr))
381 "Line: 381 ioctl(SIOCGIFINDEX) on interface `%.*s' failed: %s\n",
388 /* lookup the hardware type */
389 memset (&sll, 0, sizeof(sll));
390 sll.sll_family = AF_PACKET;
391 sll.sll_ifindex = ifr.ifr_ifindex;
392 sll.sll_protocol = htons(ETH_P_ALL);
393 if (-1 == ioctl(dev->fd_raw, SIOCGIFHWADDR, &ifr))
396 "ioctl(SIOCGIFHWADDR) on interface `%.*s' failed: %s\n",
404 memset(&wrq, 0, sizeof(struct iwreq));
405 strncpy(wrq.ifr_name, dev->iface, IFNAMSIZ);
406 if (-1 == ioctl(dev->fd_raw, SIOCGIWMODE, &wrq))
408 /* most probably not supported (ie for rtap ipw interface) *
409 * so just assume its correctly set... */
410 wrq.u.mode = IW_MODE_MONITOR;
413 if ( ( (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211) &&
414 (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_PRISM) &&
415 (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_FULL) ) ||
416 (wrq.u.mode != IW_MODE_MONITOR) )
419 "Error: interface `%.*s' is not in monitor mode\n",
425 /* Is interface st to up, broadcast & running ? */
426 if ((ifr.ifr_flags | IFF_UP | IFF_BROADCAST | IFF_RUNNING) != ifr.ifr_flags)
428 /* Bring interface up*/
429 ifr.ifr_flags |= IFF_UP | IFF_BROADCAST | IFF_RUNNING;
431 if (-1 == ioctl(dev->fd_raw, SIOCSIFFLAGS, &ifr))
434 "Line: 434 ioctl(SIOCSIFFLAGS) on interface `%.*s' failed: %s\n",
442 /* bind the raw socket to the interface */
443 if (-1 == bind(dev->fd_raw, (struct sockaddr *) &sll, sizeof(sll)))
446 "Failed to bind interface `%.*s': %s\n",
453 /* lookup the hardware type */
454 if (-1 == ioctl(dev->fd_raw, SIOCGIFHWADDR, &ifr))
457 "Line: 457 ioctl(SIOCGIFHWADDR) on interface `%.*s' failed: %s\n",
465 ifr.ifr_hwaddr.sa_data,
467 dev->arptype_in = ifr.ifr_hwaddr.sa_family;
468 if ( (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211) &&
469 (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_PRISM) &&
470 (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_FULL) )
473 "Unsupported hardware link type %d on interface `%.*s'\n",
474 ifr.ifr_hwaddr.sa_family,
480 /* enable promiscuous mode */
481 memset(&mr, 0, sizeof(mr));
482 mr.mr_ifindex = sll.sll_ifindex;
483 mr.mr_type = PACKET_MR_PROMISC;
484 if (0 != setsockopt(dev->fd_raw, SOL_PACKET, PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)))
487 "Failed to enable promiscuous mode on interface `%.*s'\n",
497 * @return 0 on success
500 wlaninit (struct Hardware_Infos *dev,
507 dev->fd_raw = socket (PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
511 "Failed to create raw socket: %s\n",
515 if (dev->fd_raw >= FD_SETSIZE)
518 "File descriptor too large for select (%d > %d)\n",
525 /* mac80211 stack detection */
526 ret = snprintf(strbuf,
528 "/sys/class/net/%s/phy80211/subsystem",
531 (ret >= sizeof (strbuf)) ||
532 (0 != stat(strbuf, &sbuf)) )
535 "Did not find 802.11 interface `%s'. Exiting.\n",
540 strncpy(dev->iface, iface, IFNAMSIZ);
541 if (0 != openraw(dev))
551 * Function to test incoming packets mac for being our own.
553 * @param u8aIeeeHeader buffer of the packet
554 * @param dev the Hardware_Infos struct
555 * @return 0 if mac belongs to us, 1 if mac is for another target
558 mac_test (const struct ieee80211_frame *u8aIeeeHeader,
559 const struct Hardware_Infos *dev)
561 if (0 != memcmp(u8aIeeeHeader->i_addr3, &mac_bssid, MAC_ADDR_SIZE))
563 if (0 == memcmp(u8aIeeeHeader->i_addr1, dev->pl_mac, MAC_ADDR_SIZE))
565 if (0 == memcmp(u8aIeeeHeader->i_addr1, &bc_all_mac, MAC_ADDR_SIZE))
572 * function to set the wlan header to make attacks more difficult
573 * @param buf buffer of the packet
574 * @param dev pointer to the Hardware_Infos struct
577 mac_set (struct ieee80211_frame *u8aIeeeHeader,
578 const struct Hardware_Infos * dev)
580 u8aIeeeHeader->i_fc[0] = 0x08;
581 u8aIeeeHeader->i_fc[1] = 0x00;
582 memcpy(u8aIeeeHeader->i_addr2,
585 memcpy(u8aIeeeHeader->i_addr3,
591 struct RadioTapheader
593 struct ieee80211_radiotap_header header;
600 stdin_send_hw (void *cls,
602 const struct GNUNET_MessageHeader *hdr)
604 struct Hardware_Infos * dev = cls;
605 struct sendbuf *write_pout = &dev->write_pout;
606 struct Radiotap_Send * header = (struct Radiotap_Send *) &hdr[1];
607 struct ieee80211_frame * wlanheader;
610 // struct? // FIXME: make nice...
611 struct RadioTapheader rtheader;
612 rtheader.header.it_version = 0;
613 rtheader.header.it_len = htole16(0x0c);
614 rtheader.header.it_present = htole32(0x00008004);
615 rtheader.rate = 0x00;
616 rtheader.txflags = htole16(IEEE80211_RADIOTAP_F_TX_NOACK | IEEE80211_RADIOTAP_F_TX_NOSEQ);
618 /* { 0x00, 0x00, <-- radiotap version
619 0x0c, 0x00, <- radiotap header length
620 0x04, 0x80, 0x00, 0x00, <-- bitmap
622 0x00, <-- padding for natural alignment
623 0x18, 0x00, <-- TX flags
626 sendsize = ntohs(hdr->size);
627 if (sendsize < sizeof(struct Radiotap_Send) + sizeof(struct GNUNET_MessageHeader))
630 "Function stdin_send_hw: mailformed packet (too small)\n");
633 sendsize -= sizeof(struct Radiotap_Send) + sizeof(struct GNUNET_MessageHeader);
635 if (MAXLINE < sendsize)
638 "Function stdin_send_hw: Packet too big for buffer\n");
641 if (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs(hdr->type))
643 fprintf(stderr, "Function stdin_send: wrong packet type\n");
647 rtheader.header.it_len = htole16(sizeof(rtheader));
648 rtheader.rate = header->rate;
649 memcpy(write_pout->buf, &rtheader, sizeof(rtheader));
650 memcpy(write_pout->buf + sizeof(rtheader), &header[1], sendsize);
651 /* payload contains MAC address, but we don't trust it, so we'll
652 overwrite it with OUR MAC address again to prevent mischief */
653 wlanheader = (struct ieee80211_frame *) (write_pout->buf + sizeof(rtheader));
654 mac_set(wlanheader, dev);
655 write_pout->size = sendsize + sizeof(rtheader);
660 maketest(unsigned char * buf, struct Hardware_Infos * dev)
663 static uint16_t seqenz = 0;
664 static int first = 0;
666 const int rate = 11000000;
669 "Hallo1Hallo2 Hallo3 Hallo4...998877665544332211Hallo1Hallo2 Hallo3 Hallo4...998877665544332211";
671 unsigned char u8aRadiotap[] =
672 { 0x00, 0x00, // <-- radiotap version
673 0x00, 0x00, // <- radiotap header length
674 0x04, 0x80, 0x02, 0x00, // <-- bitmap
676 0x00, // <-- padding for natural alignment
677 0x10, 0x00, // <-- TX flags
681 /*uint8_t u8aRadiotap[] =
683 0x00, 0x00, // <-- radiotap version
684 0x19, 0x00, // <- radiotap header length
685 0x6f, 0x08, 0x00, 0x00, // <-- bitmap
686 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // <-- timestamp
687 0x00, // <-- flags (Offset +0x10)
688 0x6c, // <-- rate (0ffset +0x11)
689 0x71, 0x09, 0xc0, 0x00, // <-- channel
690 0xde, // <-- antsignal
691 0x00, // <-- antnoise
695 u8aRadiotap[8] = (rate / 500000);
696 u8aRadiotap[2] = htole16(sizeof(u8aRadiotap));
698 static struct ieee80211_frame u8aIeeeHeader;
700 uint8_t u8aIeeeHeader_def[] =
701 { 0x08, 0x00, // Frame Control 0x08= 00001000 -> | b1,2 = 0 -> Version 0;
702 // b3,4 = 10 -> Data; b5-8 = 0 -> Normal Data
703 // 0x01 = 00000001 -> | b1 = 1 to DS; b2 = 0 not from DS;
704 0x00, 0x00, // Duration/ID
706 //0x00, 0x1f, 0x3f, 0xd1, 0x8e, 0xe6, // mac1 - in this case receiver
707 0x00, 0x1d, 0xe0, 0xb0, 0x17, 0xdf, // mac1 - in this case receiver
708 0xC0, 0x3F, 0x0E, 0x44, 0x2D, 0x51, // mac2 - in this case sender
709 //0x02, 0x1d, 0xe0, 0x00, 0x01, 0xc4,
710 0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac3 - in this case bssid
711 0x10, 0x86, //Sequence Control
715 memcpy(&u8aIeeeHeader, u8aIeeeHeader_def, sizeof(struct ieee80211_frame));
716 memcpy(u8aIeeeHeader.i_addr2, dev->pl_mac, MAC_ADDR_SIZE);
720 tmp16 = (uint16_t*) u8aIeeeHeader.i_dur;
722 = (uint16_t) htole16((sizeof(txt) + sizeof(struct ieee80211_frame) * 1000000) / rate + 290);
723 tmp16 = (uint16_t*) u8aIeeeHeader.i_seq;
724 *tmp16 = (*tmp16 & IEEE80211_SEQ_FRAG_MASK) | (htole16(seqenz)
725 << IEEE80211_SEQ_SEQ_SHIFT);
728 memcpy(buf, u8aRadiotap, sizeof(u8aRadiotap));
729 memcpy(buf + sizeof(u8aRadiotap), &u8aIeeeHeader, sizeof(u8aIeeeHeader));
730 memcpy(buf + sizeof(u8aRadiotap) + sizeof(u8aIeeeHeader), txt, sizeof(txt));
731 return sizeof(u8aRadiotap) + sizeof(u8aIeeeHeader) + sizeof(txt);
738 * function to create GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL message for plugin
739 * @param buffer pointer to buffer for the message
740 * @param mac pointer to the mac address
741 * @return number of bytes written
743 // FIXME: use 'struct MacAddress' for 'mac' (everywhere in this file)
745 send_mac_to_plugin(char * buffer, uint8_t * mac)
747 struct Wlan_Helper_Control_Message macmsg;
749 macmsg.hdr.size = htons(sizeof(struct Wlan_Helper_Control_Message));
750 macmsg.hdr.type = htons(GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL);
751 memcpy(macmsg.mac.mac, mac, sizeof(struct MacAddress));
752 memcpy(buffer, &macmsg, sizeof(struct Wlan_Helper_Control_Message));
753 return sizeof(struct Wlan_Helper_Control_Message);
758 hardwaremode (int argc,
762 struct Hardware_Infos dev;
763 char readbuf[MAXLINE];
764 struct sendbuf write_std;
771 struct GNUNET_SERVER_MessageStreamTokenizer * stdin_mst;
773 if (0 != wlaninit(&dev, argv[1]))
776 if (0 != setresuid(uid, uid, uid))
779 "Failed to setresuid: %s\n",
781 /* not critical, continue anyway */
784 dev.write_pout.size = 0;
785 dev.write_pout.pos = 0;
786 stdin_mst = GNUNET_SERVER_mst_create (&stdin_send_hw, &dev);
788 /* send mac to STDOUT first */
790 write_std.size = send_mac_to_plugin((char *) &write_std.buf, dev.pl_mac);
797 if ( (0 == dev.write_pout.size) &&
800 FD_SET (STDIN_FILENO, &rfds);
801 maxfd = MAX (maxfd, STDIN_FILENO);
803 if (0 == write_std.size)
805 FD_SET (dev.fd_raw, &rfds);
806 maxfd = MAX(maxfd, dev.fd_raw);
809 if (0 < write_std.size)
811 FD_SET (STDOUT_FILENO, &wfds);
812 maxfd = MAX(maxfd, STDOUT_FILENO);
814 if (0 < dev.write_pout.size)
816 FD_SET(dev.fd_raw, &wfds);
817 maxfd = MAX(maxfd, dev.fd_raw);
819 retval = select(maxfd + 1, &rfds, &wfds, NULL, NULL);
820 if ( (-1 == retval) &&
826 "select failed: %s\n",
831 if (FD_ISSET(STDOUT_FILENO, &wfds))
833 ret = write(STDOUT_FILENO,
834 write_std.buf + write_std.pos,
835 write_std.size - write_std.pos);
839 "Failed to write to STDOUT: %s\n",
843 write_std.pos += ret;
844 if (write_std.pos == write_std.size)
851 if (FD_ISSET(dev.fd_raw, &wfds))
853 ret = write (dev.fd_raw,
855 dev.write_pout.size);
859 "Line %u: Failed to write to WLAN device: %s, Message-Size: %u\n",__LINE__,
860 strerror (errno), dev.write_pout.size);
863 dev.write_pout.pos += ret;
864 if ( (dev.write_pout.pos != dev.write_pout.size) &&
868 "Line %u: Write error, partial send: %u/%u\n",__LINE__,
869 dev.write_pout.pos, dev.write_pout.size);
872 if (dev.write_pout.pos == dev.write_pout.size)
874 dev.write_pout.pos = 0;
875 dev.write_pout.size = 0;
879 if (FD_ISSET(STDIN_FILENO, &rfds))
881 ret = read(STDIN_FILENO, readbuf, sizeof(readbuf));
885 "Read error from STDIN: %s\n",
891 /* stop reading... */
894 GNUNET_SERVER_mst_receive (stdin_mst, NULL,
896 GNUNET_NO, GNUNET_NO);
899 if (FD_ISSET(dev.fd_raw, &rfds))
901 struct GNUNET_MessageHeader * header;
902 struct Radiotap_rx * rxinfo;
903 struct ieee80211_frame * datastart;
905 header = (struct GNUNET_MessageHeader *) write_std.buf;
906 rxinfo = (struct Radiotap_rx *) &header[1];
907 datastart = (struct ieee80211_frame *) &rxinfo[1];
908 ret = linux_read (&dev,
909 (unsigned char *) datastart,
910 sizeof(write_std.buf) - sizeof(struct Radiotap_rx) - sizeof(struct GNUNET_MessageHeader),
915 "Read error from raw socket: %s\n",
920 (0 == mac_test(datastart, &dev)) )
922 write_std.size = ret + sizeof(struct GNUNET_MessageHeader) + sizeof(struct Radiotap_rx);
923 header->size = htons(write_std.size);
924 header->type = htons(GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
929 /* Error handling, try to clean up a bit at least */
930 GNUNET_SERVER_mst_destroy(stdin_mst);
936 main(int argc, char *argv[])
941 "This program must be started with the interface as argument.\nThis program was compiled at ----- %s ----\n", __TIMESTAMP__ );
943 "Usage: interface-name\n"
947 return hardwaremode(argc , argv);