|
|
| version 1.1, 2012/02/21 23:32:47 | version 1.1.1.2, 2013/07/22 08:44:29 |
|---|---|
| Line 59 | Line 59 |
| #include <netgraph/ng_ppp.h> | #include <netgraph/ng_ppp.h> |
| #include "defs.h" | #include "defs.h" |
| #include "msg.h" | |
| /* | /* |
| * DEFINITIONS | * DEFINITIONS |
| Line 77 | Line 78 |
| #define RWLOCK_RDLOCK(m) assert(pthread_rwlock_rdlock(&m) == 0) | #define RWLOCK_RDLOCK(m) assert(pthread_rwlock_rdlock(&m) == 0) |
| #define RWLOCK_WRLOCK(m) assert(pthread_rwlock_wrlock(&m) == 0) | #define RWLOCK_WRLOCK(m) assert(pthread_rwlock_wrlock(&m) == 0) |
| #define RWLOCK_UNLOCK(m) assert(pthread_rwlock_unlock(&m) == 0) | #define RWLOCK_UNLOCK(m) assert(pthread_rwlock_unlock(&m) == 0) |
| #define SETOVERLOAD(q) do { \ | |
| int t = (q); \ | |
| if (t > 60) { \ | |
| gOverload = 100; \ | |
| } else if (t > 10) { \ | |
| gOverload = (t - 10) * 2; \ | |
| } else { \ | |
| gOverload = 0; \ | |
| } \ | |
| } while (0) | |
| #define SETOVERLOAD(q) \ | |
| do { \ | |
| int t = (q); \ | |
| if (t > gQThresMax) { \ | |
| gOverload = 100; \ | |
| } else if (t > gQThresMin) { \ | |
| gOverload = (t - gQThresMin) * 100/gQThresDiff; \ | |
| } else { \ | |
| gOverload = 0; \ | |
| } \ | |
| } while (0) | |
| #define OVERLOAD() (gOverload > (random() % 100)) | #define OVERLOAD() (gOverload > (random() % 100)) |
| #define REF(p) do { \ | #define REF(p) do { \ |
| Line 211 | Line 213 |
| #ifdef USE_NG_BPF | #ifdef USE_NG_BPF |
| extern struct acl *acl_filters[ACL_FILTERS]; /* mpd's internal bpf filters */ | extern struct acl *acl_filters[ACL_FILTERS]; /* mpd's internal bpf filters */ |
| #endif | |
| #ifdef USE_PAM | |
| extern char gPamService[32]; | |
| #endif | #endif |
| extern struct pevent_ctx *gPeventCtx; | extern struct pevent_ctx *gPeventCtx; |