version 1.1.1.4, 2019/10/22 13:49:55
|
version 1.1.1.5, 2021/03/17 00:39:23
|
Line 72
|
Line 72
|
static void BundBmTimeout(void *arg); |
static void BundBmTimeout(void *arg); |
|
|
static void BundReasses(Bund b); |
static void BundReasses(Bund b); |
static int BundSetCommand(Context ctx, int ac, char *av[], void *arg); | static int BundSetCommand(Context ctx, int ac, const char *const av[], const void *arg); |
|
|
static void BundNcpsUp(Bund b); |
static void BundNcpsUp(Bund b); |
static void BundNcpsDown(Bund b); |
static void BundNcpsDown(Bund b); |
Line 115
|
Line 115
|
BundSetCommand, NULL, 2, (void *) SET_YES }, |
BundSetCommand, NULL, 2, (void *) SET_YES }, |
{ "no {opt ...}", "Disable and deny option", |
{ "no {opt ...}", "Disable and deny option", |
BundSetCommand, NULL, 2, (void *) SET_NO }, |
BundSetCommand, NULL, 2, (void *) SET_NO }, |
{ NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
}; |
}; |
|
|
/* |
/* |
Line 918 BundUpdateParams(Bund b)
|
Line 918 BundUpdateParams(Bund b)
|
*/ |
*/ |
|
|
int |
int |
BundCommand(Context ctx, int ac, char *av[], void *arg) | BundCommand(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
Bund sb; |
Bund sb; |
int j, k; |
int j, k; |
|
|
|
(void)arg; |
|
|
if (ac > 1) |
if (ac > 1) |
return (-1); |
return (-1); |
|
|
Line 962 BundCommand(Context ctx, int ac, char *av[], void *arg
|
Line 964 BundCommand(Context ctx, int ac, char *av[], void *arg
|
*/ |
*/ |
|
|
int |
int |
MSessionCommand(Context ctx, int ac, char *av[], void *arg) | MSessionCommand(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
int k; |
int k; |
|
|
|
(void)arg; |
|
|
if (ac > 1) |
if (ac > 1) |
return (-1); |
return (-1); |
|
|
Line 1006 MSessionCommand(Context ctx, int ac, char *av[], void
|
Line 1010 MSessionCommand(Context ctx, int ac, char *av[], void
|
*/ |
*/ |
|
|
int |
int |
IfaceCommand(Context ctx, int ac, char *av[], void *arg) | IfaceCommand(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
int k; |
int k; |
|
|
|
(void)arg; |
|
|
if (ac > 1) |
if (ac > 1) |
return (-1); |
return (-1); |
|
|
Line 1050 IfaceCommand(Context ctx, int ac, char *av[], void *ar
|
Line 1056 IfaceCommand(Context ctx, int ac, char *av[], void *ar
|
*/ |
*/ |
|
|
int |
int |
BundCreate(Context ctx, int ac, char *av[], void *arg) | BundCreate(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
Bund b, bt = NULL; |
Bund b, bt = NULL; |
u_char tmpl = 0; |
u_char tmpl = 0; |
u_char stay = 0; |
u_char stay = 0; |
int k; |
int k; |
|
|
|
(void)arg; |
|
|
RESETREF(ctx->lnk, NULL); |
RESETREF(ctx->lnk, NULL); |
RESETREF(ctx->bund, NULL); |
RESETREF(ctx->bund, NULL); |
RESETREF(ctx->rep, NULL); |
RESETREF(ctx->rep, NULL); |
Line 1154 BundCreate(Context ctx, int ac, char *av[], void *arg)
|
Line 1162 BundCreate(Context ctx, int ac, char *av[], void *arg)
|
*/ |
*/ |
|
|
int |
int |
BundDestroy(Context ctx, int ac, char *av[], void *arg) | BundDestroy(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
Bund b; |
Bund b; |
|
|
|
(void)arg; |
|
|
if (ac > 1) |
if (ac > 1) |
return(-1); |
return(-1); |
|
|
Line 1192 BundDestroy(Context ctx, int ac, char *av[], void *arg
|
Line 1202 BundDestroy(Context ctx, int ac, char *av[], void *arg
|
*/ |
*/ |
|
|
Bund |
Bund |
BundInst(Bund bt, char *name, int tmpl, int stay) | BundInst(Bund bt, const char *name, int tmpl, int stay) |
{ |
{ |
Bund b; |
Bund b; |
int k; |
int k; |
Line 1276 BundShutdown(Bund b)
|
Line 1286 BundShutdown(Bund b)
|
*/ |
*/ |
|
|
int |
int |
BundStat(Context ctx, int ac, char *av[], void *arg) | BundStat(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
Bund sb; |
Bund sb; |
int k, bw, tbw, nup; |
int k, bw, tbw, nup; |
char buf[64]; |
char buf[64]; |
|
|
|
(void)arg; |
|
|
/* Find bundle they're talking about */ |
/* Find bundle they're talking about */ |
switch (ac) { |
switch (ac) { |
case 0: |
case 0: |
Line 1550 BundBmTimeout(void *arg)
|
Line 1562 BundBmTimeout(void *arg)
|
if (b->links[k] && b->links[k]->joined_bund) { |
if (b->links[k] && b->links[k]->joined_bund) { |
Link const l = b->links[k]; |
Link const l = b->links[k]; |
|
|
|
#ifndef NG_PPP_STATS64 |
struct ng_ppp_link_stat oldStats; |
struct ng_ppp_link_stat oldStats; |
|
#else |
|
struct ng_ppp_link_stat64 oldStats; |
|
#endif |
|
|
/* Get updated link traffic statistics */ |
/* Get updated link traffic statistics */ |
oldStats = l->bm.idleStats; |
oldStats = l->bm.idleStats; |
|
#ifndef NG_PPP_STATS64 |
NgFuncGetStats(l->bund, l->bundleIndex, &l->bm.idleStats); |
NgFuncGetStats(l->bund, l->bundleIndex, &l->bm.idleStats); |
|
#else |
|
NgFuncGetStats64(l->bund, l->bundleIndex, &l->bm.idleStats); |
|
#endif |
b->bm.traffic[0][0] += l->bm.idleStats.recvOctets - oldStats.recvOctets; |
b->bm.traffic[0][0] += l->bm.idleStats.recvOctets - oldStats.recvOctets; |
b->bm.traffic[1][0] += l->bm.idleStats.xmitOctets - oldStats.xmitOctets; |
b->bm.traffic[1][0] += l->bm.idleStats.xmitOctets - oldStats.xmitOctets; |
} |
} |
Line 1704 BundNgInit(Bund b)
|
Line 1724 BundNgInit(Bund b)
|
newPpp = 1; |
newPpp = 1; |
|
|
/* Get PPP node ID */ |
/* Get PPP node ID */ |
b->nodeID = NgGetNodeID(gLinksCsock, b->hook); | if ((b->nodeID = NgGetNodeID(gLinksCsock, b->hook)) == 0) { |
| Perror("[%s] Cannot get %s node id", b->name, NG_PPP_NODE_TYPE); |
| goto fail; |
| } |
|
|
/* Give it a name */ |
/* Give it a name */ |
memset(&nm, 0, sizeof(nm)); |
memset(&nm, 0, sizeof(nm)); |
Line 1749 BundNgShutdown(Bund b, int iface, int ppp)
|
Line 1772 BundNgShutdown(Bund b, int iface, int ppp)
|
*/ |
*/ |
|
|
static int |
static int |
BundSetCommand(Context ctx, int ac, char *av[], void *arg) | BundSetCommand(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
Bund b = ctx->bund; |
Bund b = ctx->bund; |
int i, val; |
int i, val; |