/* See the DRL-LICENSE file for this file's software license. */ #ifndef _RATEROUTER_H_ #define _RATEROUTER_H_ #define _XOPEN_SOURCE 600 /* for pthread_rwlock_t */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* defines getifaddrs */ #include enum policies { POLICY_GRD = 1, POLICY_FPS = 2 }; enum commfabrics { COMM_MESH = 1, COMM_GOSSIP = 2 }; enum accountings { ACT_STANDARD = 1, ACT_SAMPLEHOLD = 2, ACT_SIMPLE = 3, ACT_MULTIPLE = 4 }; enum dampenings { DAMPEN_NONE = 0, DAMPEN_TEST = 1, DAMPEN_FAILED = 2, DAMPEN_PASSED = 3, DAMPEN_SKIP = 4 }; enum memberships { SWIM = 1, ZOOKEEPER = 2 }; enum failure_behaviors { PANIC = 1, QUORUM = 2 }; /* The comm library also has definitions for comfabrics. This prevents us * from defining them twice. */ #define COMM_DEFS /* global constants */ #define IDENT_CLEAN_INTERVAL 5 /* in seconds */ #define LIMITER_LISTEN_PORT 9001 /** * The weight percentage increase that must occur before FPS does increase * dampening. */ #define LARGE_INCREASE_PERCENTAGE (0.05) /** * Below this rate, a limiter is basically treated as idle, and its limit is * raised to allow for increases should the limiter suddenly become active. * * This is used for FPS only. See estimate.c */ #define FLOW_START_THRESHOLD (10000) #define CLOSE_ENOUGH (0.90) #define GRD_BIG_DROP (0.90) /** * All fields come from the ip protocol header. * * 1 byte for the protocol. * 4 bytes for the source ip. * 4 bytes for the destination ip. * 2 bytes for the source port. * 2 bytes for the destination port. * * 4+4+2+2+1 = 13. */ #define FLOWKEYSIZE (13) /* Causes each identity to track every flow in two tables. One table is as * specified in the config file. The second is a standard table with * "perfect" accounting so that we can compare the two. Turn this off for * any type of production setting. */ //#define SHADOW_ACCTING /* Turn this on to simulate network partitions. * Turn off for production settings. */ #define ALLOW_PARTITION /* forward declare some structs */ struct limiter; struct identity; /* prototypes for threaded processing DRL model */ void handle_estimation(void *arg); #endif