Fix reporting of IPv6 multicast addresses.
[oss-qm-packages.git] / lib / irda.c
blobfa147fed707910e777b750ac3dfaec3325414d3b
1 /*********************************************************************
2 *
3 * Filename: irda.c
4 * Version: 0.1
5 * Description: A first attempt to make ifconfig understand IrDA
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Wed Apr 21 09:03:09 1999
9 * Modified at: Wed Apr 21 09:17:05 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * MA 02111-1307 USA
27 ********************************************************************/
29 #include "config.h"
31 #if HAVE_AFIRDA || HAVE_HWIRDA
32 #include <sys/types.h>
33 #include <sys/ioctl.h>
34 #include <sys/socket.h>
35 #include <net/if_arp.h>
36 #include <stdlib.h>
37 #include <stdio.h>
38 #include <ctype.h>
39 #include <errno.h>
40 #include <fcntl.h>
41 #include <string.h>
42 #include <termios.h>
43 #include <unistd.h>
44 #include "net-support.h"
45 #include "pathnames.h"
46 #include "intl.h"
47 #include "util.h"
49 /* Probably not a good idea to include <linux/if_arp.h> */
50 #ifndef ARPHRD_IRDA
51 #define ARPHRD_IRDA 783
52 #endif
55 * Function irda_print (ptr)
57 * Print hardware address of interface
60 static char *irda_print(unsigned char *ptr)
62 static char buff[8];
64 sprintf(&buff[strlen(buff)], "%02x:%02x:%02x:%02x", ptr[3], ptr[2],
65 ptr[1], ptr[0]);
67 return (buff);
70 struct hwtype irda_hwtype =
72 "irda", NULL, ARPHRD_IRDA, 2,
73 irda_print, NULL, NULL, 0
76 #endif /* HAVE_xxIRDA */