… | |
… | |
30 | |
30 | |
31 | #include "slog.h" |
31 | #include "slog.h" |
32 | #include "ev_cpp.h" |
32 | #include "ev_cpp.h" |
33 | #include "callback.h" |
33 | #include "callback.h" |
34 | |
34 | |
35 | typedef ev::ev_tstamp tstamp; |
35 | typedef ev_tstamp tstamp; |
36 | |
36 | |
37 | /* |
37 | /* |
38 | * check for an existing gvpe for this net, and write pid to pidfile |
38 | * check for an existing gvpe for this net, and write pid to pidfile |
39 | */ |
39 | */ |
40 | extern int write_pidfile (void); |
40 | extern int write_pidfile (void); |
… | |
… | |
60 | |
60 | |
61 | extern void id2mac (unsigned int id, void *m); |
61 | extern void id2mac (unsigned int id, void *m); |
62 | |
62 | |
63 | #define mac2id(p) ((p)[0] & 0x01 ? 0 : ((p)[4] << 8) | (p)[5]) |
63 | #define mac2id(p) ((p)[0] & 0x01 ? 0 : ((p)[4] << 8) | (p)[5]) |
64 | |
64 | |
65 | struct sliding_window { |
65 | struct sliding_window |
|
|
66 | { |
66 | u32 v[(WINDOWSIZE + 31) / 32]; |
67 | u32 v[(WINDOWSIZE + 31) / 32]; |
67 | u32 seq; |
68 | u32 seq; |
68 | |
69 | |
69 | void reset (u32 seqno) |
70 | void reset (u32 seqno) |
70 | { |
71 | { |
… | |
… | |
109 | |
110 | |
110 | return false; |
111 | return false; |
111 | } |
112 | } |
112 | }; |
113 | }; |
113 | |
114 | |
114 | typedef callback0<const char *> run_script_cb; |
115 | typedef callback<const char * ()> run_script_cb; |
115 | |
116 | |
116 | // run a shell script (or actually an external program). |
117 | // run a shell script (or actually an external program). |
117 | bool run_script (const run_script_cb &cb, bool wait); |
118 | bool run_script (const run_script_cb &cb, bool wait); |
118 | |
119 | |
119 | #if ENABLE_HTTP_PROXY |
120 | #if ENABLE_HTTP_PROXY |