… | |
… | |
21 | Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
22 | */ |
22 | */ |
23 | |
23 | |
24 | #ifndef UTIL_H__ |
24 | #ifndef UTIL_H__ |
25 | #define UTIL_H__ |
25 | #define UTIL_H__ |
|
|
26 | |
|
|
27 | #include <cstring> |
26 | |
28 | |
27 | #include <openssl/rsa.h> |
29 | #include <openssl/rsa.h> |
28 | |
30 | |
29 | #include "gettext.h" |
31 | #include "gettext.h" |
30 | |
32 | |
… | |
… | |
60 | |
62 | |
61 | extern void id2mac (unsigned int id, void *m); |
63 | extern void id2mac (unsigned int id, void *m); |
62 | |
64 | |
63 | #define mac2id(p) ((p)[0] & 0x01 ? 0 : ((p)[4] << 8) | (p)[5]) |
65 | #define mac2id(p) ((p)[0] & 0x01 ? 0 : ((p)[4] << 8) | (p)[5]) |
64 | |
66 | |
65 | struct sliding_window { |
67 | struct sliding_window |
|
|
68 | { |
66 | u32 v[(WINDOWSIZE + 31) / 32]; |
69 | u32 v[(WINDOWSIZE + 31) / 32]; |
67 | u32 seq; |
70 | u32 seq; |
68 | |
71 | |
69 | void reset (u32 seqno) |
72 | void reset (u32 seqno) |
70 | { |
73 | { |
… | |
… | |
109 | |
112 | |
110 | return false; |
113 | return false; |
111 | } |
114 | } |
112 | }; |
115 | }; |
113 | |
116 | |
114 | typedef callback0<const char *> run_script_cb; |
117 | typedef callback<const char * ()> run_script_cb; |
115 | |
118 | |
116 | // run a shell script (or actually an external program). |
119 | // run a shell script (or actually an external program). |
117 | bool run_script (const run_script_cb &cb, bool wait); |
120 | bool run_script (const run_script_cb &cb, bool wait); |
118 | |
121 | |
119 | #if ENABLE_HTTP_PROXY |
122 | #if ENABLE_HTTP_PROXY |