2 * netsniff-ng - the packet sniffing beast
3 * Copyright 2009, 2010 Daniel Borkmann.
4 * Subject to the GPL, version 2.
8 #include <sys/socket.h>
10 #include <linux/tcp.h>
16 void set_udp_cork(int fd
)
20 ret
= setsockopt(fd
, IPPROTO_UDP
, UDP_CORK
, &state
, sizeof(state
));
22 panic("Cannot cork UDP socket!\n");
25 void set_udp_uncork(int fd
)
29 ret
= setsockopt(fd
, IPPROTO_UDP
, UDP_CORK
, &state
, sizeof(state
));
31 panic("Cannot uncork UDP socket!\n");
34 void set_tcp_cork(int fd
)
38 ret
= setsockopt(fd
, IPPROTO_TCP
, TCP_CORK
, &state
, sizeof(state
));
40 panic("Cannot cork TCP socket!\n");
43 void set_tcp_uncork(int fd
)
47 ret
= setsockopt(fd
, IPPROTO_TCP
, TCP_CORK
, &state
, sizeof(state
));
49 panic("Cannot uncork TCP socket!\n");
52 void set_sock_cork(int fd
, bool is_udp
)
60 void set_sock_uncork(int fd
, bool is_udp
)