aboutsummaryrefslogtreecommitdiff
blob: a64876b3b4db7947b7c043135ca977e9107a6e84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*********************************************************************
 *                
 * Filename:      irda.c
 * Version:       0.2
 * Description:   A second attempt to make ifconfig understand IrDA
 * Status:        Experimental.
 * Author:        Dag Brattli <dagb@cs.uit.no>
 * Created at:    Wed Apr 21 09:03:09 1999
 * Modified at:   Wed Apr 21 09:17:05 1999
 * Modified by:   Dag Brattli <dagb@cs.uit.no>
 * Modified at:   Wed May  1 11:51:44 CEST 2002
 * Modified by:   Christoph Bartelmus <christoph@bartelmus.de>
 * 
 *     This program is free software; you can redistribute it and/or 
 *     modify it under the terms of the GNU General Public License as 
 *     published by the Free Software Foundation; either version 2 of 
 *     the License, or (at your option) any later version.
 * 
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *     GNU General Public License for more details.
 * 
 *     You should have received a copy of the GNU General Public License 
 *     along with this program; if not, write to the Free Software 
 *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 *     MA 02111-1307 USA
 *     
 ********************************************************************/

#include "config.h"

#if HAVE_AFIRDA || HAVE_HWIRDA
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include "net-support.h"
#include "pathnames.h"
#include "intl.h"
#include "util.h"

/* Probably not a good idea to include <linux/if_arp.h> */
#ifndef ARPHRD_IRDA
#define ARPHRD_IRDA 783
#endif

/*
 * Function irda_print (ptr)
 *
 *    Print hardware address of interface
 *
 */
static const char *irda_print(const char *ptr)
{
    static char buff[12];

    snprintf(buff, 12, "%02x:%02x:%02x:%02x", ptr[3], ptr[2], 
	    ptr[1], ptr[0]);

    return (buff);
}

struct hwtype irda_hwtype =
{
     "irda", NULL, ARPHRD_IRDA, 2,
     irda_print, NULL, NULL, 0
};

#endif				/* HAVE_xxIRDA */