Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 109 lines (77 sloc) 2.2 kb
a5e0187b » vwelch
1995-04-21 Initial revision
1 /*
2 netlog.h
3
4 This file should be included in the users application. It will
5 redirect various calls so that they are logged by the netlog
6 library.
7 */
8
9 #ifndef NETLOG
10 #define NETLOG
11
12 #ifdef __hpux /* Need to make sure these are included first */
13 #include <sys/socket.h>
14 #include <sys/uio.h>
15 #endif /* __hpux */
16
17 /*
18 On the Cray sendmsg and recvmsg get redefined, so we check and
19 make sure that's the case, then undefine them so the precompiler
20 doesn't complain when we redefine them.
21 */
22 #ifdef CRAY
23 # include <sys/types.h>
24 # include <sys/socket.h>
25
26 # ifdef recvmsg
27 # undef recvmsg
28 # endif
29
30 # ifdef sendmsg
31 # undef sendmsg
32 # endif
33
34 #endif
35
36
37 /*
38 Used to insert comments into log
39 */
40 void netlog_comment();
41
42
43 /*
44 Macros to redirect user's libc calls to libnetlog
45 */
46
47 #define accept(s, a, al) log_accept(s, a, al)
48 int log_accept();
49
50 #define bind(s, n, nl) log_bind(s, n, nl)
51 int log_bind();
52
53 #define close(s) log_close(s)
54 int log_close();
55
56 #define connect(s, n, nl) log_connect(s, n, nl)
57 int log_connect();
58
59 #define listen(s, bl) log_listen(s, bl)
60 int log_listen();
61
62 #define recv(s, b, l, f) log_recv(s, b, l, f)
63 int log_recv();
64
65 #define recvfrom(s, b, l, f, fr, frl) log_recvfrom(s, b, l, f, fr, frl)
66 int log_recvfrom();
67
68 #define recvmsg(s, m, f) log_recvmsg(s, m, f)
69 int log_recvmsg();
70
71 #define read(s, b, nb) log_read(s, b, nb)
72 int log_read();
73
74 #ifndef CRAY /* Doesn't exist on the Cray */
75 #define readv(f, i, ic) log_readv(f, i, ic)
76 int log_readv();
77 #endif
78
79 #define send(s, m, l, f) log_send(s, m, l, f)
80 int log_send();
81
82 #define sendmsg(s, m, f) log_sendmsg(s, m, f)
83 int log_sendmsg();
84
85 #define sendto(s, m, l, f, t, tl) log_sendto(s, m, l, f, t, tl)
86 int log_sendto();
87
88 #define setsockopt(s, l, on, ov, ol) log_setsockopt(s, l, on, ov, ol)
89 int log_setsockopt();
90
91 #define shutdown(s,h) log_shutdown(s,h)
92 int log_shutdown();
93
94 #define socket(d, t, p) log_socket(d, t, p)
95 int log_socket();
96
97 #define socketpair(d, t, p, s) log_socketpair(d, t, p, s)
98 int log_socketpair();
99
100 #define write(s, b, nb) log_write(s, b, nb)
101 int log_write();
102
103 #ifndef CRAY /* Doesn't exit on the Cray */
104 #define writev(f, i, ic) log_writev(f, i, ic)
105 int log_writev();
106 #endif
107
108
109 #endif /* NETLOG */
Something went wrong with that request. Please try again.