proc: move out process specific management functions
[netsniff-ng.git] / xutils.h
blob83d710ac40afc206ee3f7c2bf642992125f65c79
1 /*
2 * netsniff-ng - the packet sniffing beast
3 * Copyright 2009, 2010 Daniel Borkmann.
4 * Copyright 2009, 2010 Emmanuel Roullit.
5 * Subject to the GPL, version 2.
6 */
8 #ifndef XSYS_H
9 #define XSYS_H
11 #define _GNU_SOURCE
12 #include <errno.h>
13 #include <stdint.h>
14 #include <sys/socket.h>
15 #include <unistd.h>
16 #include <linux/ethtool.h>
17 #include <linux/if.h>
18 #include <linux/wireless.h>
19 #include <poll.h>
20 #include <sys/poll.h>
21 #include <sched.h>
22 #include <stdbool.h>
23 #include <sys/resource.h>
24 #include <sys/time.h>
26 #include "built_in.h"
28 extern int af_socket(int af);
29 extern int pf_socket(void);
30 extern int wireless_sigqual(const char *ifname, struct iw_statistics *stats);
31 extern int wireless_rangemax_sigqual(const char *ifname);
32 extern u32 wireless_bitrate(const char *ifname);
33 extern u32 ethtool_bitrate(const char *ifname);
34 extern int ethtool_drvinf(const char *ifname, struct ethtool_drvinfo *drvinf);
35 extern int ethtool_link(const char *ifname);
36 extern void set_nonblocking(int fd);
37 extern int set_nonblocking_sloppy(int fd);
38 extern int set_reuseaddr(int fd);
39 extern void set_sock_prio(int fd, int prio);
40 extern void set_tcp_nodelay(int fd);
41 extern void set_socket_keepalive(int fd);
42 extern int set_ipv6_only(int fd);
43 extern void set_mtu_disc_dont(int fd);
44 extern int get_system_socket_mem(int which);
45 extern void set_system_socket_mem(int which, int val);
46 extern void register_signal(int signal, void (*handler)(int));
47 extern void register_signal_f(int signal, void (*handler)(int), int flags);
48 extern void set_epoll_descriptor(int fd_epoll, int action, int fd_toadd, int events);
49 extern int set_epoll_descriptor2(int fd_epoll, int action, int fd_toadd, int events);
50 extern void set_system_socket_memory(int *vals, size_t len);
51 extern void reset_system_socket_memory(int *vals, size_t len);
52 extern void set_itimer_interval_value(struct itimerval *itimer, unsigned long sec,
53 unsigned long usec);
55 #endif /* XSYS_H */