--- embedaddon/mpd/src/ppp.h 2012/02/21 23:32:47 1.1.1.1 +++ embedaddon/mpd/src/ppp.h 2013/07/22 08:44:29 1.1.1.2 @@ -59,6 +59,7 @@ #include #include "defs.h" +#include "msg.h" /* * DEFINITIONS @@ -77,18 +78,19 @@ #define RWLOCK_RDLOCK(m) assert(pthread_rwlock_rdlock(&m) == 0) #define RWLOCK_WRLOCK(m) assert(pthread_rwlock_wrlock(&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 REF(p) do { \ @@ -211,6 +213,10 @@ #ifdef USE_NG_BPF extern struct acl *acl_filters[ACL_FILTERS]; /* mpd's internal bpf filters */ +#endif + +#ifdef USE_PAM + extern char gPamService[32]; #endif extern struct pevent_ctx *gPeventCtx;