003 File Manager
Current Path:
/usr/src/libexec/bootpd
usr
/
src
/
libexec
/
bootpd
/
📁
..
📄
Announce
(2.36 KB)
📄
Changes
(9.82 KB)
📄
ConvOldTab.sh
(3.69 KB)
📄
Installation
(742 B)
📄
Makefile
(322 B)
📄
Makefile.UNIX
(5.33 KB)
📄
Makefile.depend
(289 B)
📄
Makefile.inc
(52 B)
📄
Problems
(2.59 KB)
📄
README
(5.18 KB)
📄
ToDo
(2.18 KB)
📄
bootp.h
(5.05 KB)
📄
bootpd.8
(7.63 KB)
📄
bootpd.c
(33.69 KB)
📄
bootpd.h
(5.2 KB)
📁
bootpgw
📄
bootptab.5
(10.33 KB)
📄
bootptab.cmu
(4.14 KB)
📄
bootptab.mcs
(2.49 KB)
📄
bptypes.h
(303 B)
📄
dovend.c
(9.87 KB)
📄
dovend.h
(213 B)
📄
dumptab.c
(8.79 KB)
📄
getether.c
(9.06 KB)
📄
getether.h
(82 B)
📄
getif.c
(3.04 KB)
📄
getif.h
(82 B)
📄
hash.c
(9.95 KB)
📄
hash.h
(4.72 KB)
📄
hwaddr.c
(8.8 KB)
📄
hwaddr.h
(900 B)
📄
lookup.c
(2.28 KB)
📄
lookup.h
(243 B)
📄
patchlevel.h
(86 B)
📄
readfile.c
(46.45 KB)
📄
readfile.h
(288 B)
📄
report.c
(2.47 KB)
📄
report.h
(168 B)
📄
rtmsg.c
(6.17 KB)
📄
syslog.conf
(2.08 KB)
📁
tools
📄
trygetea.c
(940 B)
📄
trygetif.c
(1.34 KB)
📄
trylook.c
(817 B)
📄
tzone.c
(951 B)
📄
tzone.h
(66 B)
Editing: trygetif.c
/* * trygetif.c - test program for getif.c * * $FreeBSD$ */ #include <sys/types.h> #include <sys/socket.h> #if defined(SUNOS) || defined(SVR4) #include <sys/sockio.h> #endif #ifdef _AIX32 #include <sys/time.h> /* for struct timeval in net/if.h */ #endif #include <net/if.h> /* for struct ifreq */ #include <netinet/in.h> #include <arpa/inet.h> /* inet_ntoa */ #include <netdb.h> #include <stdio.h> #include <ctype.h> #include <errno.h> #include "getif.h" int debug = 0; char *progname; void main(argc, argv) int argc; char **argv; { struct hostent *hep; struct sockaddr_in *sip; /* Interface address */ struct ifreq *ifr; struct in_addr dst_addr; struct in_addr *dap; int s; progname = argv[0]; /* for report */ dap = NULL; if (argc > 1) { dap = &dst_addr; if (isdigit(argv[1][0])) dst_addr.s_addr = inet_addr(argv[1]); else { hep = gethostbyname(argv[1]); if (!hep) { printf("gethostbyname(%s)\n", argv[1]); exit(1); } memcpy(&dst_addr, hep->h_addr, sizeof(dst_addr)); } } s = socket(AF_INET, SOCK_DGRAM, 0); if (s < 0) { perror("socket open"); exit(1); } ifr = getif(s, dap); if (!ifr) { printf("no interface for address\n"); exit(1); } printf("Intf-name:%s\n", ifr->ifr_name); sip = (struct sockaddr_in *) &(ifr->ifr_addr); printf("Intf-addr:%s\n", inet_ntoa(sip->sin_addr)); exit(0); }
Upload File
Create Folder