version 1.1, 2012/02/21 23:32:47
|
version 1.1.1.2, 2021/03/17 00:39:23
|
Line 152 Pred1Init(Bund b, int dir)
|
Line 152 Pred1Init(Bund b, int dir)
|
|
|
strlcat(path, ppphook, sizeof(path)); |
strlcat(path, ppphook, sizeof(path)); |
|
|
id = NgGetNodeID(-1, path); | if ((id = NgGetNodeID(-1, path)) == 0) { |
| Perror("[%s] Cannot get %s node id", b->name, NG_PRED1_NODE_TYPE); |
| goto fail; |
| } |
| |
if (dir == COMP_DIR_XMIT) { |
if (dir == COMP_DIR_XMIT) { |
b->ccp.comp_node_id = id; |
b->ccp.comp_node_id = id; |
} else { |
} else { |
Line 165 Pred1Init(Bund b, int dir)
|
Line 169 Pred1Init(Bund b, int dir)
|
NGM_PRED1_COOKIE, NGM_PRED1_CONFIG, &conf, sizeof(conf)) < 0) { |
NGM_PRED1_COOKIE, NGM_PRED1_CONFIG, &conf, sizeof(conf)) < 0) { |
Perror("[%s] can't config %s node at %s", |
Perror("[%s] can't config %s node at %s", |
b->name, NG_PRED1_NODE_TYPE, path); |
b->name, NG_PRED1_NODE_TYPE, path); |
NgFuncShutdownNode(gCcpCsock, b->name, path); | goto fail; |
return(-1); | |
} |
} |
#endif |
#endif |
return 0; |
return 0; |
|
|
|
fail: |
|
NgFuncShutdownNode(gCcpCsock, b->name, path); |
|
return(-1); |
} |
} |
|
|
/* |
/* |
Line 378 Pred1Decompress(Bund b, Mbuf mbcomp)
|
Line 385 Pred1Decompress(Bund b, Mbuf mbcomp)
|
static Mbuf |
static Mbuf |
Pred1RecvResetReq(Bund b, int id, Mbuf bp, int *noAck) |
Pred1RecvResetReq(Bund b, int id, Mbuf bp, int *noAck) |
{ |
{ |
|
(void)id; |
|
(void)bp; |
|
(void)noAck; |
#ifndef USE_NG_PRED1 |
#ifndef USE_NG_PRED1 |
Pred1Info p = &b->ccp.pred1; |
Pred1Info p = &b->ccp.pred1; |
|
|
|
(void)id; |
|
(void)bp; |
|
(void)noAck; |
|
|
Pred1Init(b, COMP_DIR_XMIT); |
Pred1Init(b, COMP_DIR_XMIT); |
p->xmit_stats.Errors++; |
p->xmit_stats.Errors++; |
#else |
#else |
char path[NG_PATHSIZ]; |
char path[NG_PATHSIZ]; |
|
|
|
(void)id; |
|
(void)bp; |
|
(void)noAck; |
|
|
/* Forward ResetReq to the Predictor1 compression node */ |
/* Forward ResetReq to the Predictor1 compression node */ |
snprintf(path, sizeof(path), "[%x]:", b->ccp.comp_node_id); |
snprintf(path, sizeof(path), "[%x]:", b->ccp.comp_node_id); |
if (NgSendMsg(gCcpCsock, path, |
if (NgSendMsg(gCcpCsock, path, |
Line 391 Pred1RecvResetReq(Bund b, int id, Mbuf bp, int *noAck)
|
Line 411 Pred1RecvResetReq(Bund b, int id, Mbuf bp, int *noAck)
|
Perror("[%s] reset to %s node", b->name, NG_PRED1_NODE_TYPE); |
Perror("[%s] reset to %s node", b->name, NG_PRED1_NODE_TYPE); |
} |
} |
#endif |
#endif |
return(NULL); | return(NULL); |
} |
} |
|
|
/* |
/* |
Line 403 Pred1SendResetReq(Bund b)
|
Line 423 Pred1SendResetReq(Bund b)
|
{ |
{ |
#ifndef USE_NG_PRED1 |
#ifndef USE_NG_PRED1 |
Pred1Init(b, COMP_DIR_RECV); |
Pred1Init(b, COMP_DIR_RECV); |
|
#else |
|
(void)b; |
#endif |
#endif |
return(NULL); |
return(NULL); |
} |
} |
Line 415 static void
|
Line 437 static void
|
Pred1RecvResetAck(Bund b, int id, Mbuf bp) |
Pred1RecvResetAck(Bund b, int id, Mbuf bp) |
{ |
{ |
#ifndef USE_NG_PRED1 |
#ifndef USE_NG_PRED1 |
|
(void)id; |
|
(void)bp; |
Pred1Init(b, COMP_DIR_RECV); |
Pred1Init(b, COMP_DIR_RECV); |
#else |
#else |
char path[NG_PATHSIZ]; |
char path[NG_PATHSIZ]; |
|
|
|
(void)id; |
|
(void)bp; |
|
|
/* Forward ResetReq to the Predictor1 decompression node */ |
/* Forward ResetReq to the Predictor1 decompression node */ |
snprintf(path, sizeof(path), "[%x]:", b->ccp.decomp_node_id); |
snprintf(path, sizeof(path), "[%x]:", b->ccp.decomp_node_id); |
if (NgSendMsg(gCcpCsock, path, |
if (NgSendMsg(gCcpCsock, path, |
Line 434 Pred1RecvResetAck(Bund b, int id, Mbuf bp)
|
Line 462 Pred1RecvResetAck(Bund b, int id, Mbuf bp)
|
static u_char * |
static u_char * |
Pred1BuildConfigReq(Bund b, u_char *cp, int *ok) |
Pred1BuildConfigReq(Bund b, u_char *cp, int *ok) |
{ |
{ |
|
(void)b; |
cp = FsmConfValue(cp, CCP_TY_PRED1, 0, NULL); |
cp = FsmConfValue(cp, CCP_TY_PRED1, 0, NULL); |
*ok = 1; |
*ok = 1; |
return (cp); |
return (cp); |
Line 464 Pred1DecodeConfigReq(Fsm fp, FsmOption opt, int mode)
|
Line 493 Pred1DecodeConfigReq(Fsm fp, FsmOption opt, int mode)
|
static int |
static int |
Pred1Negotiated(Bund b, int dir) |
Pred1Negotiated(Bund b, int dir) |
{ |
{ |
|
(void)b; |
|
(void)dir; |
|
|
return 1; |
return 1; |
} |
} |
|
|
Line 474 Pred1Negotiated(Bund b, int dir)
|
Line 506 Pred1Negotiated(Bund b, int dir)
|
static int |
static int |
Pred1SubtractBloat(Bund b, int size) |
Pred1SubtractBloat(Bund b, int size) |
{ |
{ |
|
(void)b; |
return(size - 4); |
return(size - 4); |
} |
} |
|
|