Deleted Added
full compact
trygetea.c (13573) trygetea.c (18471)
1/*
2 * trygetea.c - test program for getether.c
1/*
2 * trygetea.c - test program for getether.c
3 *
4 * $Id$
3 */
4
5#include <sys/types.h>
6#include <sys/socket.h>
7
8#if defined(SUNOS) || defined(SVR4)
9#include <sys/sockio.h>
10#endif
11
12#ifdef _AIX32
13#include <sys/time.h> /* for struct timeval in net/if.h */
14#endif
15#include <net/if.h> /* for struct ifreq */
16#include <netinet/in.h>
17#include <arpa/inet.h> /* inet_ntoa */
18
19#include <netdb.h>
20#include <stdio.h>
21#include <ctype.h>
22#include <errno.h>
23
24#include "getether.h"
25
26int debug = 0;
27char *progname;
28
29void
30main(argc, argv)
31 int argc;
32 char **argv;
33{
34 u_char ea[16]; /* Ethernet address */
35 int i;
36
37 progname = argv[0]; /* for report */
38
39 if (argc < 2) {
40 printf("need interface name\n");
41 exit(1);
42 }
43 if ((i = getether(argv[1], (char*)ea)) < 0) {
44 printf("Could not get Ethernet address (rc=%d)\n", i);
45 exit(1);
46 }
47 printf("Ether-addr");
48 for (i = 0; i < 6; i++)
49 printf(":%x", ea[i] & 0xFF);
50 printf("\n");
51
52 exit(0);
53}
5 */
6
7#include <sys/types.h>
8#include <sys/socket.h>
9
10#if defined(SUNOS) || defined(SVR4)
11#include <sys/sockio.h>
12#endif
13
14#ifdef _AIX32
15#include <sys/time.h> /* for struct timeval in net/if.h */
16#endif
17#include <net/if.h> /* for struct ifreq */
18#include <netinet/in.h>
19#include <arpa/inet.h> /* inet_ntoa */
20
21#include <netdb.h>
22#include <stdio.h>
23#include <ctype.h>
24#include <errno.h>
25
26#include "getether.h"
27
28int debug = 0;
29char *progname;
30
31void
32main(argc, argv)
33 int argc;
34 char **argv;
35{
36 u_char ea[16]; /* Ethernet address */
37 int i;
38
39 progname = argv[0]; /* for report */
40
41 if (argc < 2) {
42 printf("need interface name\n");
43 exit(1);
44 }
45 if ((i = getether(argv[1], (char*)ea)) < 0) {
46 printf("Could not get Ethernet address (rc=%d)\n", i);
47 exit(1);
48 }
49 printf("Ether-addr");
50 for (i = 0; i < 6; i++)
51 printf(":%x", ea[i] & 0xFF);
52 printf("\n");
53
54 exit(0);
55}