--- embedaddon/mpd/src/ccp.c 2016/11/01 09:56:12 1.1.1.2 +++ embedaddon/mpd/src/ccp.c 2021/03/17 00:39:23 1.1.1.3 @@ -58,7 +58,7 @@ static void CcpRecvResetAck(Fsm fp, int id, Mbuf bp); static int CcpCheckEncryption(Bund b); - static int CcpSetCommand(Context ctx, int ac, char *av[], void *arg); + static int CcpSetCommand(Context ctx, int ac, const char *const av[], const void *arg); static CompType CcpFindComp(int type, int *indexp); static const char *CcpTypeName(int type, char *buf, size_t len); @@ -82,7 +82,7 @@ CcpSetCommand, NULL, 2, (void *) SET_YES }, { "no [opt ...]", "Disable and deny option", CcpSetCommand, NULL, 2, (void *) SET_NO }, - { NULL }, + { NULL, NULL, NULL, NULL, 0, NULL }, }; /* @@ -129,7 +129,7 @@ CcpFailure, CcpRecvResetReq, CcpRecvResetAck, - NULL, + NULL, NULL, NULL, NULL }; /* Names for different types of compression */ @@ -148,17 +148,17 @@ { CCP_TY_V42BIS, "V42BIS" }, { CCP_TY_BSD, "BSD" }, { CCP_TY_LZS_DCP, "LZS-DCP" }, - { CCP_TY_DEFLATE24, "DEFLATE24" }, + { CCP_TY_MVRCA, "MVRCA" }, { CCP_TY_DCE, "DCE" }, { CCP_TY_DEFLATE, "DEFLATE" }, { CCP_TY_V44, "V.44/LZJH" }, { 0, NULL }, }; - int gCcpCsock = -1; /* Socket node control socket */ - int gCcpDsock = -1; /* Socket node data socket */ - EventRef gCcpCtrlEvent; - EventRef gCcpDataEvent; +int gCcpCsock = -1; /* Socket node control socket */ +int gCcpDsock = -1; /* Socket node data socket */ +static EventRef gCcpCtrlEvent; +static EventRef gCcpDataEvent; int CcpsInit(void) @@ -211,7 +211,7 @@ CcpInit(Bund b) /* Construct options list if we haven't done so already */ if (gConfList == NULL) { struct confinfo *ci; - int k; + unsigned k; ci = Malloc(MB_COMP, (CCP_NUM_PROTOS + 1) * sizeof(*ci)); for (k = 0; k < CCP_NUM_PROTOS; k++) { @@ -249,7 +249,7 @@ CcpConfigure(Fsm fp) { Bund b = (Bund)fp->arg; CcpState const ccp = &b->ccp; - int k; + unsigned k; /* Reset state */ ccp->self_reject = 0; @@ -282,7 +282,7 @@ CcpUnConfigure(Fsm fp) { Bund b = (Bund)fp->arg; CcpState const ccp = &b->ccp; - int k; + unsigned k; /* Reset state */ ccp->self_reject = 0; @@ -315,6 +315,9 @@ CcpNgCtrlEvent(int type, void *cookie) int i, len; ng_ID_t id; + (void)cookie; + (void)type; + /* Read message */ if ((len = NgRecvMsg(gCcpCsock, &u.msg, sizeof(u), raddr)) < 0) { Perror("CcpNgCtrlEvent: can't read message"); @@ -376,6 +379,9 @@ CcpNgDataEvent(int type, void *cookie) char *bundname, *rest; int id; + (void)cookie; + (void)type; + while (1) { /* Protect from bundle shutdown and DoS */ if (num > 100) @@ -439,6 +445,8 @@ CcpRecvMsg(Bund b, struct ng_mesg *msg, int len) CcpState const ccp = &b->ccp; Fsm const fp = &ccp->fsm; + (void)len; + switch (msg->header.typecookie) { #ifdef USE_NG_MPPC case NGM_MPPC_COOKIE: @@ -562,6 +570,8 @@ static void CcpFailure(Fsm fp, enum fsmfail reason) { Bund b = (Bund)fp->arg; + + (void)reason; CcpCheckEncryption(b); } @@ -570,7 +580,7 @@ CcpFailure(Fsm fp, enum fsmfail reason) */ int -CcpStat(Context ctx, int ac, char *av[], void *arg) +CcpStat(Context ctx, int ac, const char *const av[], const void *arg) { CcpState const ccp = &ctx->bund->ccp; char buf[64]; @@ -746,7 +756,7 @@ CcpBuildConfigReq(Fsm fp, u_char *cp) { Bund b = (Bund)fp->arg; CcpState const ccp = &b->ccp; - int type; + unsigned type; int ok; /* Put in all options that peer hasn't rejected in preferred order */ @@ -1025,6 +1035,8 @@ fail: FsmFailure(&b->ipcp.fsm, FAIL_CANT_ENCRYPT); FsmFailure(&b->ipv6cp.fsm, FAIL_CANT_ENCRYPT); return(-1); +#else + (void)b; #endif return (0); } @@ -1034,7 +1046,7 @@ fail: */ static int -CcpSetCommand(Context ctx, int ac, char *av[], void *arg) +CcpSetCommand(Context ctx, int ac, const char *const av[], const void *arg) { CcpState const ccp = &ctx->bund->ccp; @@ -1078,7 +1090,7 @@ CcpSetCommand(Context ctx, int ac, char *av[], void *a static CompType CcpFindComp(int type, int *indexp) { - int k; + unsigned k; for (k = 0; k < CCP_NUM_PROTOS; k++) { if (gCompTypes[k]->type == type) {