man/pt_BR/ifconfig.8: remove untranslated paragraph
[platform/upstream/net-tools.git] / lib / irda.c
1 /*********************************************************************
2  *                
3  * Filename:      irda.c
4  * Version:       0.2
5  * Description:   A second 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>
11  * Modified at:   Wed May  1 11:51:44 CEST 2002
12  * Modified by:   Christoph Bartelmus <christoph@bartelmus.de>
13  * 
14  *     This program is free software; you can redistribute it and/or 
15  *     modify it under the terms of the GNU General Public License as 
16  *     published by the Free Software Foundation; either version 2 of 
17  *     the License, or (at your option) any later version.
18  * 
19  *     This program is distributed in the hope that it will be useful,
20  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  *     GNU General Public License for more details.
23  * 
24  *     You should have received a copy of the GNU General Public License 
25  *     along with this program; if not, write to the Free Software 
26  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
27  *     MA 02111-1307 USA
28  *     
29  ********************************************************************/
30
31 #include "config.h"
32
33 #if HAVE_AFIRDA || HAVE_HWIRDA
34 #include <sys/types.h>
35 #include <sys/ioctl.h>
36 #include <sys/socket.h>
37 #include <net/if_arp.h>
38 #include <stdlib.h>
39 #include <stdio.h>
40 #include <ctype.h>
41 #include <errno.h>
42 #include <fcntl.h>
43 #include <string.h>
44 #include <termios.h>
45 #include <unistd.h>
46 #include "net-support.h"
47 #include "pathnames.h"
48 #include "intl.h"
49 #include "util.h"
50
51 /* Probably not a good idea to include <linux/if_arp.h> */
52 #ifndef ARPHRD_IRDA
53 #define ARPHRD_IRDA 783
54 #endif
55
56 /*
57  * Function irda_print (ptr)
58  *
59  *    Print hardware address of interface
60  *
61  */
62 static const char *irda_print(const char *ptr)
63 {
64     static char buff[12];
65
66     snprintf(buff, 12, "%02x:%02x:%02x:%02x", ptr[3], ptr[2], 
67             ptr[1], ptr[0]);
68
69     return (buff);
70 }
71
72 struct hwtype irda_hwtype =
73 {
74      "irda", NULL, ARPHRD_IRDA, 2,
75      irda_print, NULL, NULL, 0
76 };
77
78 #endif                          /* HAVE_xxIRDA */