version 1.1.1.2, 2013/07/22 08:44:29
|
version 1.1.1.3, 2016/11/01 09:56:12
|
Line 167
|
Line 167
|
{ 0, GLOBAL_CONF_TCPWRAPPER, "tcp-wrapper" }, |
{ 0, GLOBAL_CONF_TCPWRAPPER, "tcp-wrapper" }, |
#endif |
#endif |
{ 0, GLOBAL_CONF_ONESHOT, "one-shot" }, |
{ 0, GLOBAL_CONF_ONESHOT, "one-shot" }, |
|
{ 0, GLOBAL_CONF_AGENT_CID, "agent-cid" }, |
|
{ 0, GLOBAL_CONF_SESS_TIME, "session-time" }, |
{ 0, 0, NULL }, |
{ 0, 0, NULL }, |
}; |
}; |
|
|
Line 357
|
Line 359
|
}; |
}; |
|
|
const struct cmdtab gCommands[] = { |
const struct cmdtab gCommands[] = { |
{ "authname {name}", "Choose link by auth name", | { "authname {name} [CI]", "Choose link by auth name", |
AuthnameCommand, NULL, 0, NULL }, |
AuthnameCommand, NULL, 0, NULL }, |
{ "bundle [{name}]", "Choose/list bundles", |
{ "bundle [{name}]", "Choose/list bundles", |
BundCommand, NULL, 0, NULL }, |
BundCommand, NULL, 0, NULL }, |
Line 383
|
Line 385
|
MSessionCommand, NULL, 0, NULL }, |
MSessionCommand, NULL, 0, NULL }, |
{ "open [{layer}]", "Open a layer", |
{ "open [{layer}]", "Open a layer", |
OpenCommand, NULL, 1, NULL }, |
OpenCommand, NULL, 1, NULL }, |
{ "quit", "Quit program", | { "shutdown", "Shutdown program", |
QuitCommand, NULL, 2, NULL }, |
QuitCommand, NULL, 2, NULL }, |
{ "repeater [{name}]", "Choose/list repeaters", |
{ "repeater [{name}]", "Choose/list repeaters", |
RepCommand, NULL, 0, NULL }, |
RepCommand, NULL, 0, NULL }, |
Line 887 ShowVersion(Context ctx, int ac, char *av[], void *arg
|
Line 889 ShowVersion(Context ctx, int ac, char *av[], void *arg
|
#else |
#else |
Printf(" config fetch : no\r\n"); |
Printf(" config fetch : no\r\n"); |
#endif |
#endif |
|
#ifdef USE_BACKTRACE |
|
Printf(" backtrace() : yes\r\n"); |
|
#else |
|
Printf(" backtrace() : no\r\n"); |
|
#endif |
#ifdef USE_NG_BPF |
#ifdef USE_NG_BPF |
Printf(" ng_bpf : yes\r\n"); |
Printf(" ng_bpf : yes\r\n"); |
#else |
#else |
Line 1162 CloseCommand(Context ctx, int ac, char *av[], void *ar
|
Line 1169 CloseCommand(Context ctx, int ac, char *av[], void *ar
|
static Layer |
static Layer |
GetLayer(const char *name) |
GetLayer(const char *name) |
{ |
{ |
int k, found; | size_t k; |
| int found; |
|
|
if (name == NULL) |
if (name == NULL) |
name = "iface"; |
name = "iface"; |
Line 1189 GetLayer(const char *name)
|
Line 1197 GetLayer(const char *name)
|
static int |
static int |
ShowLayers(Context ctx, int ac, char *av[], void *arg) |
ShowLayers(Context ctx, int ac, char *av[], void *arg) |
{ |
{ |
int k; | size_t k; |
|
|
Printf("\tName\t\tDescription\r\n"); |
Printf("\tName\t\tDescription\r\n"); |
Printf("\t----\t\t-----------\r\n"); |
Printf("\t----\t\t-----------\r\n"); |
Line 1311 ShowSessions(Context ctx, int ac, char *av[], void *ar
|
Line 1319 ShowSessions(Context ctx, int ac, char *av[], void *ar
|
int l; |
int l; |
Bund B; |
Bund B; |
Link L; |
Link L; |
char peer[64], addr[64]; | char peer[64], addr[64], buf[64]; |
|
|
if (ac != 0 && ac != 1) |
if (ac != 0 && ac != 1) |
return (-1); |
return (-1); |
Line 1379 out:
|
Line 1387 out:
|
L->lcp.auth.params.authname, |
L->lcp.auth.params.authname, |
peer |
peer |
); |
); |
|
if (Enabled(&gGlobalConf.options, GLOBAL_CONF_AGENT_CID)) { |
|
PhysGetSelfName(L, buf, sizeof(buf)); |
|
Printf("\t%s", buf); |
|
} |
|
if (Enabled(&gGlobalConf.options, GLOBAL_CONF_SESS_TIME)) { |
|
if (L->state == PHYS_STATE_UP) |
|
Printf("\t%ld", (long int)(time(NULL) - L->last_up)); |
|
} |
Printf("\r\n"); |
Printf("\r\n"); |
} |
} |
} |
} |
Line 1430 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1446 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
if (!SLIST_EMPTY(&iface->routes) || !SLIST_EMPTY(&b->params.routes)) { |
if (!SLIST_EMPTY(&iface->routes) || !SLIST_EMPTY(&b->params.routes)) { |
Printf("\tRoutes via peer :\r\n"); |
Printf("\tRoutes via peer :\r\n"); |
SLIST_FOREACH(r, &iface->routes, next) |
SLIST_FOREACH(r, &iface->routes, next) |
Printf("\t\t%s\r\n", u_rangetoa(&r->dest,buf,sizeof(buf))); | Printf("\t\t: %s\r\n", u_rangetoa(&r->dest,buf,sizeof(buf))); |
SLIST_FOREACH(r, &b->params.routes, next) |
SLIST_FOREACH(r, &b->params.routes, next) |
Printf("\t\t%s\r\n", u_rangetoa(&r->dest,buf,sizeof(buf))); | Printf("\t\t: %s\r\n", u_rangetoa(&r->dest,buf,sizeof(buf))); |
} |
} |
#ifdef USE_IPFW |
#ifdef USE_IPFW |
if (b->params.acl_pipe) { |
if (b->params.acl_pipe) { |
Printf("\tIPFW pipes :\r\n"); |
Printf("\tIPFW pipes :\r\n"); |
a = b->params.acl_pipe; |
a = b->params.acl_pipe; |
while (a) { |
while (a) { |
Printf("\t\t%d (%d)\t'%s'\r\n", a->number, a->real_number, a->rule); | Printf("\t\t%d (%d)\t: '%s'\r\n", a->number, a->real_number, a->rule); |
a = a->next; |
a = a->next; |
} |
} |
} |
} |
Line 1447 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1463 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Printf("\tIPFW queues :\r\n"); |
Printf("\tIPFW queues :\r\n"); |
a = b->params.acl_queue; |
a = b->params.acl_queue; |
while (a) { |
while (a) { |
Printf("\t\t%d (%d)\t'%s'\r\n", a->number, a->real_number, a->rule); | Printf("\t\t%d (%d)\t: '%s'\r\n", a->number, a->real_number, a->rule); |
a = a->next; |
a = a->next; |
} |
} |
} |
} |
Line 1456 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1472 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
a = b->params.acl_table; |
a = b->params.acl_table; |
while (a) { |
while (a) { |
if (a->number != 0) |
if (a->number != 0) |
Printf("\t\t%d (%d)\t'%s'\r\n", a->number, a->real_number, a->rule); | Printf("\t\t%d (%d)\t: '%s'\r\n", a->number, a->real_number, a->rule); |
else |
else |
Printf("\t\t(%d)\t'%s'\r\n", a->real_number, a->rule); | Printf("\t\t(%d)\t: '%s'\r\n", a->real_number, a->rule); |
a = a->next; |
a = a->next; |
} |
} |
} |
} |
Line 1466 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1482 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Printf("\tIPFW rules :\r\n"); |
Printf("\tIPFW rules :\r\n"); |
a = b->params.acl_rule; |
a = b->params.acl_rule; |
while (a) { |
while (a) { |
Printf("\t\t%d (%d)\t'%s'\r\n", a->number, a->real_number, a->rule); | Printf("\t\t%d (%d)\t: '%s'\r\n", a->number, a->real_number, a->rule); |
a = a->next; |
a = a->next; |
} |
} |
} |
} |
Line 1480 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1496 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
if (a == NULL) |
if (a == NULL) |
a = acl_filters[k]; |
a = acl_filters[k]; |
while (a) { |
while (a) { |
Printf("\t\t%d#%d\t'%s'\r\n", (k + 1), a->number, a->rule); | Printf("\t\t%d#%d\t: '%s'\r\n", (k + 1), a->number, a->rule); |
a = a->next; |
a = a->next; |
} |
} |
} |
} |
Line 1488 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1504 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
for (k = 0; k < 2; k++) { |
for (k = 0; k < 2; k++) { |
a = b->params.acl_limits[k]; |
a = b->params.acl_limits[k]; |
while (a) { |
while (a) { |
Printf("\t\t%s#%d%s%s\t'%s'\r\n", (k?"out":"in"), a->number, | Printf("\t\t%s#%d%s%s\t: '%s'\r\n", (k?"out":"in"), a->number, |
((a->name[0])?"#":""), a->name, a->rule); |
((a->name[0])?"#":""), a->name, a->rule); |
a = a->next; |
a = a->next; |
} |
} |