4 * (C)opyright 1997-1998 Darren Reed. (from tcplog)
6 * Redistribution and use in source and binary forms are permitted
7 * provided that this notice is preserved and due credit is given
8 * to the original author and the contributors.
14 #include <sys/types.h>
15 #include <sys/param.h>
16 #include <sys/socket.h>
18 #include <sys/ioctl.h>
21 int initdevice(device
, sport
, tout
)
27 if ((fd
= socket(AF_DLI
, SOCK_RAW
, 0)) == -1)
34 * output an IP packet onto a fd opened for /dev/bpf
36 int sendip(fd
, pkt
, len
)
40 if (send(fd
, pkt
, len
, 0) == -1)
55 if ((s
= (char *)malloc(strlen(str
) + 1)))
56 return strcpy(s
, str
);
60 * (C)opyright 1997 Darren Reed. (from tcplog)
62 * Redistribution and use in source and binary forms are permitted
63 * provided that this notice is preserved and due credit is given
64 * to the original author and the contributors.
70 #include <sys/types.h>
71 #include <sys/param.h>
72 #include <sys/socket.h>
74 #include <sys/ioctl.h>
77 int initdevice(device
, sport
, tout
)
83 if ((fd
= socket(AF_DLI
, SOCK_RAW
, 0)) == -1)
90 * output an IP packet onto a fd opened for /dev/bpf
92 int sendip(fd
, pkt
, len
)
96 if (send(fd
, pkt
, len
, 0) == -1)
111 if ((s
= (char *)malloc(strlen(str
) + 1)))
112 return strcpy(s
, str
);