summaryrefslogtreecommitdiff
path: root/source4/lib/socket_wrapper/socket_wrapper.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-09-12 06:19:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:26 -0500
commitb5ea572f450a9161b96c9c08789791054d24df37 (patch)
treed8d558db84668b5ba41e5fdd16dbc03967c98705 /source4/lib/socket_wrapper/socket_wrapper.h
parent4de4af09426847d5f16361645dfa43dc75895189 (diff)
downloadsamba-b5ea572f450a9161b96c9c08789791054d24df37.tar.gz
samba-b5ea572f450a9161b96c9c08789791054d24df37.tar.bz2
samba-b5ea572f450a9161b96c9c08789791054d24df37.zip
r18417: overload send() and recv() by socket wrapper
and add a dummy swrap_dump_packet() function which can later dump the packet content, so that a script can then generate a capture file for wireshark metze (This used to be commit d05cab5c626b5960448f206e8c17b89edbf78733)
Diffstat (limited to 'source4/lib/socket_wrapper/socket_wrapper.h')
-rw-r--r--source4/lib/socket_wrapper/socket_wrapper.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/source4/lib/socket_wrapper/socket_wrapper.h b/source4/lib/socket_wrapper/socket_wrapper.h
index 3c4a2c01dc..b4cdcbbe32 100644
--- a/source4/lib/socket_wrapper/socket_wrapper.h
+++ b/source4/lib/socket_wrapper/socket_wrapper.h
@@ -28,7 +28,9 @@ int swrap_getsockname(int s, struct sockaddr *name, socklen_t *addrlen);
int swrap_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen);
int swrap_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
ssize_t swrap_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen);
-ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);
+ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);
+ssize_t swrap_recv(int s, void *buf, size_t len, int flags);
+ssize_t swrap_send(int s, const void *buf, size_t len, int flags);
int swrap_close(int);
#ifdef SOCKET_WRAPPER_REPLACE
@@ -78,6 +80,16 @@ int swrap_close(int);
#endif
#define sendto(s,buf,len,flags,to,tolen) swrap_sendto(s,buf,len,flags,to,tolen)
+#ifdef recv
+#undef recv
+#endif
+#define recv(s,buf,len,flags) swrap_recv(s,buf,len,flags)
+
+#ifdef send
+#undef send
+#endif
+#define send(s,buf,len,flags) swrap_send(s,buf,len,flags)
+
#ifdef socket
#undef socket
#endif