1 /* See the DRL-LICENSE file for this file's software license. */
6 #define _XOPEN_SOURCE 600 /* for pthread_rwlock_t */
10 #include <netinet/in_systm.h>
11 #include <netinet/in.h>
12 #include <netinet/ip.h>
13 #include <netinet/tcp.h>
14 #include <netinet/udp.h>
16 #include <sys/types.h>
17 #include <sys/socket.h>
22 #include <arpa/inet.h>
32 #include <ifaddrs.h> /* defines getifaddrs */
35 enum policies { POLICY_GRD = 1, POLICY_FPS = 2 };
36 enum commfabrics { COMM_MESH = 1, COMM_GOSSIP = 2 };
37 enum accountings { ACT_STANDARD = 1, ACT_SAMPLEHOLD = 2, ACT_SIMPLE = 3 };
39 /* The comm library also has definitions for comfabrics. This prevents us
40 * from defining them twice. */
43 /* global constants */
44 #define IDENT_CLEAN_INTERVAL 5 /* in seconds */
45 #define LIMITER_LISTEN_PORT 9001
48 * The weight percentage increase that must occur before FPS does increase
51 #define LARGE_INCREASE_PERCENTAGE (0.05)
54 * Below this rate, a limiter is basically treated as idle, and its limit is
55 * raised to allow for increases should the limiter suddenly become active.
57 * This is used for FPS only. See estimate.c
59 #define FLOW_START_THRESHOLD (6000)
61 #define CLOSE_ENOUGH (0.99)
64 * All fields come from the ip protocol header.
66 * 1 byte for the protocol.
67 * 4 bytes for the source ip.
68 * 4 bytes for the destination ip.
69 * 2 bytes for the source port.
70 * 2 bytes for the destination port.
74 #define FLOWKEYSIZE (13)
76 /* forward declare some structs */
80 /* prototypes for threaded processing DRL model */
81 void handle_estimation(void *arg);