|
version 1.1, 2012/02/21 23:32:47
|
version 1.1.1.4.2.1, 2023/09/27 11:08:00
|
|
Line 11
|
Line 11
|
| * See ``COPYRIGHT.whistle'' |
* See ``COPYRIGHT.whistle'' |
| */ |
*/ |
| |
|
| |
#include "msg.h" |
| #include "ppp.h" |
#include "ppp.h" |
| #include "console.h" |
#include "console.h" |
| #ifndef NOWEB |
#ifndef NOWEB |
|
Line 40
|
Line 41
|
| #ifdef USE_FETCH |
#ifdef USE_FETCH |
| #include <fetch.h> |
#include <fetch.h> |
| #endif |
#endif |
| |
#ifdef USE_NG_NETFLOW |
| |
#include <netgraph/netflow/ng_netflow.h> |
| |
#endif |
| |
|
| /* |
/* |
| * DEFINITIONS |
* DEFINITIONS |
|
Line 75
|
Line 79
|
| SET_L2TPLIMIT, |
SET_L2TPLIMIT, |
| #endif |
#endif |
| SET_MAX_CHILDREN, |
SET_MAX_CHILDREN, |
| |
SET_QTHRESHOLD, |
| #ifdef USE_NG_BPF |
#ifdef USE_NG_BPF |
| SET_FILTER |
SET_FILTER |
| #endif |
#endif |
|
Line 96
|
Line 101
|
| */ |
*/ |
| |
|
| /* Commands */ |
/* Commands */ |
| static int ShowVersion(Context ctx, int ac, char *av[], void *arg); | static int ShowVersion(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ShowLayers(Context ctx, int ac, char *av[], void *arg); | static int ShowLayers(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ShowTypes(Context ctx, int ac, char *av[], void *arg); | static int ShowTypes(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ShowSummary(Context ctx, int ac, char *av[], void *arg); | static int ShowSummary(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ShowSessions(Context ctx, int ac, char *av[], void *arg); | static int ShowSessions(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ShowCustomer(Context ctx, int ac, char *av[], void *arg); | static int ShowCustomer(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ShowEvents(Context ctx, int ac, char *av[], void *arg); | static int ShowEvents(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ShowGlobal(Context ctx, int ac, char *av[], void *arg); | static int ShowGlobal(Context ctx, int ac, const char *const av[], const void *arg); |
| static int OpenCommand(Context ctx, int ac, char *av[], void *arg); | static int OpenCommand(Context ctx, int ac, const char *const av[], const void *arg); |
| static int CloseCommand(Context ctx, int ac, char *av[], void *arg); | static int CloseCommand(Context ctx, int ac, const char *const av[], const void *arg); |
| static int LoadCommand(Context ctx, int ac, char *av[], void *arg); | static int LoadCommand(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ExitCommand(Context ctx, int ac, char *av[], void *arg); | static int ExitCommand(Context ctx, int ac, const char *const av[], const void *arg); |
| static int QuitCommand(Context ctx, int ac, char *av[], void *arg); | static int QuitCommand(Context ctx, int ac, const char *const av[], const void *arg); |
| static int GlobalSetCommand(Context ctx, int ac, char *av[], void *arg); | static int GlobalSetCommand(Context ctx, int ac, const char *const av[], const void *arg); |
| static int SetDebugCommand(Context ctx, int ac, char *av[], void *arg); | static int SetDebugCommand(Context ctx, int ac, const char *const av[], const void *arg); |
| |
|
| /* Other stuff */ |
/* Other stuff */ |
| static Layer GetLayer(const char *name); |
static Layer GetLayer(const char *name); |
|
Line 119
|
Line 124
|
| * INTERNAL VARIABLES |
* INTERNAL VARIABLES |
| */ |
*/ |
| |
|
| const struct cmdtab GlobalSetCmds[] = { | static const struct cmdtab GlobalSetCmds[] = { |
| { "enable {opt ...}", "Enable option" , |
{ "enable {opt ...}", "Enable option" , |
| GlobalSetCommand, NULL, 2, (void *) SET_ENABLE }, |
GlobalSetCommand, NULL, 2, (void *) SET_ENABLE }, |
| { "disable {opt ...}", "Disable option" , |
{ "disable {opt ...}", "Disable option" , |
|
Line 148
|
Line 153
|
| #endif |
#endif |
| { "max-children {num}", "Max number of children", |
{ "max-children {num}", "Max number of children", |
| GlobalSetCommand, NULL, 2, (void *) SET_MAX_CHILDREN }, |
GlobalSetCommand, NULL, 2, (void *) SET_MAX_CHILDREN }, |
| |
{ "qthreshold {min} {max}", "Message queue limit thresholds", |
| |
GlobalSetCommand, NULL, 2, (void *) SET_QTHRESHOLD }, |
| #ifdef USE_NG_BPF |
#ifdef USE_NG_BPF |
| { "filter {num} add|clear [\"{flt}\"]", "Global traffic filters management", |
{ "filter {num} add|clear [\"{flt}\"]", "Global traffic filters management", |
| GlobalSetCommand, NULL, 2, (void *) SET_FILTER }, |
GlobalSetCommand, NULL, 2, (void *) SET_FILTER }, |
| #endif |
#endif |
| { NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
| }; |
}; |
| |
|
| static const struct confinfo gGlobalConfList[] = { |
static const struct confinfo gGlobalConfList[] = { |
|
Line 160
|
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 168
|
Line 177
|
| LinkCreate, NULL, 2, NULL }, |
LinkCreate, NULL, 2, NULL }, |
| { "bundle [template|static] {name} {template}", "Create bundle/template", |
{ "bundle [template|static] {name} {template}", "Create bundle/template", |
| BundCreate, NULL, 2, NULL }, |
BundCreate, NULL, 2, NULL }, |
| { NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
| }; |
}; |
| |
|
| static const struct cmdtab DestroyCommands[] = { |
static const struct cmdtab DestroyCommands[] = { |
|
Line 176
|
Line 185
|
| LinkDestroy, NULL, 2, NULL }, |
LinkDestroy, NULL, 2, NULL }, |
| { "bundle [{name}]", "Destroy bundle/template", |
{ "bundle [{name}]", "Destroy bundle/template", |
| BundDestroy, NULL, 2, NULL }, |
BundDestroy, NULL, 2, NULL }, |
| { NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
| }; |
}; |
| |
|
| static const struct cmdtab ShowSessCmds[] = { |
static const struct cmdtab ShowSessCmds[] = { |
| { "iface {name}", "Filter by iface name", |
{ "iface {name}", "Filter by iface name", |
| ShowSessions, NULL, 2, (void *) SHOW_IFACE }, | ShowSessions, NULL, 0, (void *) SHOW_IFACE }, |
| { "ip {ip}", "Filter by IP address", |
{ "ip {ip}", "Filter by IP address", |
| ShowSessions, NULL, 2, (void *) SHOW_IP }, | ShowSessions, NULL, 0, (void *) SHOW_IP }, |
| { "user {name}", "Filter by user name", |
{ "user {name}", "Filter by user name", |
| ShowSessions, NULL, 2, (void *) SHOW_USER }, | ShowSessions, NULL, 0, (void *) SHOW_USER }, |
| { "session {ID}", "Filter by session ID", |
{ "session {ID}", "Filter by session ID", |
| ShowSessions, NULL, 2, (void *) SHOW_SESSION }, | ShowSessions, NULL, 0, (void *) SHOW_SESSION }, |
| { "msession {ID}", "Filter by msession ID", |
{ "msession {ID}", "Filter by msession ID", |
| ShowSessions, NULL, 2, (void *) SHOW_MSESSION }, | ShowSessions, NULL, 0, (void *) SHOW_MSESSION }, |
| { "bundle {name}", "Filter by bundle name", |
{ "bundle {name}", "Filter by bundle name", |
| ShowSessions, NULL, 2, (void *) SHOW_BUNDLE }, | ShowSessions, NULL, 0, (void *) SHOW_BUNDLE }, |
| { "link {name}", "Filter by link name", |
{ "link {name}", "Filter by link name", |
| ShowSessions, NULL, 2, (void *) SHOW_LINK }, | ShowSessions, NULL, 0, (void *) SHOW_LINK }, |
| { "peer {name}", "Filter by peer name", |
{ "peer {name}", "Filter by peer name", |
| ShowSessions, NULL, 2, (void *) SHOW_PEER }, | ShowSessions, NULL, 0, (void *) SHOW_PEER }, |
| { NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
| }; |
}; |
| |
|
| static const struct cmdtab ShowCommands[] = { |
static const struct cmdtab ShowCommands[] = { |
|
Line 214
|
Line 223
|
| #endif |
#endif |
| { "ecp", "ECP status", |
{ "ecp", "ECP status", |
| EcpStat, AdmitBund, 0, NULL }, |
EcpStat, AdmitBund, 0, NULL }, |
| |
#ifdef USE_RADIUS |
| { "eap", "EAP status", |
{ "eap", "EAP status", |
| EapStat, AdmitLink, 0, NULL }, |
EapStat, AdmitLink, 0, NULL }, |
| |
#endif |
| { "events", "Current events", |
{ "events", "Current events", |
| ShowEvents, NULL, 0, NULL }, |
ShowEvents, NULL, 0, NULL }, |
| { "ipcp", "IPCP status", |
{ "ipcp", "IPCP status", |
|
Line 244
|
Line 255
|
| LinkStat, AdmitLink, 0, NULL }, |
LinkStat, AdmitLink, 0, NULL }, |
| { "auth", "Auth status", |
{ "auth", "Auth status", |
| AuthStat, AdmitLink, 0, NULL }, |
AuthStat, AdmitLink, 0, NULL }, |
| |
#ifdef USE_RADIUS |
| { "radius", "RADIUS status", |
{ "radius", "RADIUS status", |
| RadStat, AdmitLink, 0, NULL }, |
RadStat, AdmitLink, 0, NULL }, |
| |
#endif |
| #ifdef RAD_COA_REQUEST |
#ifdef RAD_COA_REQUEST |
| { "radsrv", "RADIUS server status", |
{ "radsrv", "RADIUS server status", |
| RadsrvStat, NULL, 0, NULL }, |
RadsrvStat, NULL, 0, NULL }, |
|
Line 273
|
Line 286
|
| { "version", "Version string", |
{ "version", "Version string", |
| ShowVersion, NULL, 0, NULL }, |
ShowVersion, NULL, 0, NULL }, |
| { "sessions [ {param} {value} ]", "Active sessions", |
{ "sessions [ {param} {value} ]", "Active sessions", |
| CMD_SUBMENU, NULL, 2, (void *) ShowSessCmds}, | CMD_SUBMENU, NULL, 0, ShowSessCmds}, |
| { "summary", "Daemon status summary", |
{ "summary", "Daemon status summary", |
| ShowSummary, NULL, 0, NULL }, |
ShowSummary, NULL, 0, NULL }, |
| { NULL }, | #ifdef USE_NG_NETFLOW |
| | { "netflow", "Netflow settings", |
| | ShowNetflow, NULL, 0, NULL }, |
| | #endif |
| | { NULL, NULL, NULL, NULL, 0, NULL }, |
| }; |
}; |
| |
|
| |
static const struct cmdtab UnSetCommands[] = { |
| |
#ifdef USE_RADIUS |
| |
{ "radius ...", "RADIUS specific stuff", |
| |
CMD_SUBMENU, AdmitLink, 2, RadiusUnSetCmds }, |
| |
#endif |
| |
#ifdef NG_NAT_DESC_LENGTH |
| |
{ "nat ...", "NAT specific stuff", |
| |
CMD_SUBMENU, AdmitBund, 2, NatUnSetCmds }, |
| |
#endif |
| |
{ NULL, NULL, NULL, NULL, 0, NULL }, |
| |
}; |
| |
|
| static const struct cmdtab SetCommands[] = { |
static const struct cmdtab SetCommands[] = { |
| |
{ "auth ...", "Auth specific stuff", |
| |
CMD_SUBMENU, AdmitLink, 2, AuthSetCmds }, |
| { "bundle ...", "Bundle specific stuff", |
{ "bundle ...", "Bundle specific stuff", |
| CMD_SUBMENU, AdmitBund, 2, (void *) BundSetCmds }, | CMD_SUBMENU, AdmitBund, 2, BundSetCmds }, |
| { "link ...", "Link specific stuff", |
{ "link ...", "Link specific stuff", |
| CMD_SUBMENU, AdmitLink, 2, (void *) LinkSetCmds }, | CMD_SUBMENU, AdmitLink, 2, LinkSetCmds }, |
| { "iface ...", "Interface specific stuff", |
{ "iface ...", "Interface specific stuff", |
| CMD_SUBMENU, AdmitBund, 2, (void *) IfaceSetCmds }, | CMD_SUBMENU, AdmitBund, 2, IfaceSetCmds }, |
| { "ipcp ...", "IPCP specific stuff", |
{ "ipcp ...", "IPCP specific stuff", |
| CMD_SUBMENU, AdmitBund, 2, (void *) IpcpSetCmds }, | CMD_SUBMENU, AdmitBund, 2, IpcpSetCmds }, |
| { "ipv6cp ...", "IPV6CP specific stuff", |
{ "ipv6cp ...", "IPV6CP specific stuff", |
| CMD_SUBMENU, AdmitBund, 2, (void *) Ipv6cpSetCmds }, | CMD_SUBMENU, AdmitBund, 2, Ipv6cpSetCmds }, |
| { "ippool ...", "IP pool specific stuff", |
{ "ippool ...", "IP pool specific stuff", |
| CMD_SUBMENU, NULL, 2, (void *) IPPoolSetCmds }, | CMD_SUBMENU, NULL, 2, IPPoolSetCmds }, |
| { "ccp ...", "CCP specific stuff", |
{ "ccp ...", "CCP specific stuff", |
| CMD_SUBMENU, AdmitBund, 2, (void *) CcpSetCmds }, | CMD_SUBMENU, AdmitBund, 2, CcpSetCmds }, |
| #ifdef CCP_MPPC |
#ifdef CCP_MPPC |
| { "mppc ...", "MPPC specific stuff", |
{ "mppc ...", "MPPC specific stuff", |
| CMD_SUBMENU, AdmitBund, 2, (void *) MppcSetCmds }, | CMD_SUBMENU, AdmitBund, 2, MppcSetCmds }, |
| #endif |
#endif |
| { "ecp ...", "ECP specific stuff", |
{ "ecp ...", "ECP specific stuff", |
| CMD_SUBMENU, AdmitBund, 2, (void *) EcpSetCmds }, | CMD_SUBMENU, AdmitBund, 2, EcpSetCmds }, |
| | #ifdef USE_RADIUS |
| { "eap ...", "EAP specific stuff", |
{ "eap ...", "EAP specific stuff", |
| CMD_SUBMENU, AdmitLink, 2, (void *) EapSetCmds }, | CMD_SUBMENU, AdmitLink, 2, EapSetCmds }, |
| { "auth ...", "Auth specific stuff", | |
| CMD_SUBMENU, AdmitLink, 2, (void *) AuthSetCmds }, | |
| { "radius ...", "RADIUS specific stuff", |
{ "radius ...", "RADIUS specific stuff", |
| CMD_SUBMENU, AdmitLink, 2, (void *) RadiusSetCmds }, | CMD_SUBMENU, AdmitLink, 2, RadiusSetCmds }, |
| #ifdef RAD_COA_REQUEST |
#ifdef RAD_COA_REQUEST |
| { "radsrv ...", "RADIUS server specific stuff", |
{ "radsrv ...", "RADIUS server specific stuff", |
| CMD_SUBMENU, NULL, 2, (void *) RadsrvSetCmds }, | CMD_SUBMENU, NULL, 2, RadsrvSetCmds }, |
| #endif |
#endif |
| |
#endif |
| { "console ...", "Console specific stuff", |
{ "console ...", "Console specific stuff", |
| CMD_SUBMENU, NULL, 0, (void *) ConsoleSetCmds }, | CMD_SUBMENU, NULL, 0, ConsoleSetCmds }, |
| #ifndef NOWEB |
#ifndef NOWEB |
| { "web ...", "Web specific stuff", |
{ "web ...", "Web specific stuff", |
| CMD_SUBMENU, NULL, 2, (void *) WebSetCmds }, | CMD_SUBMENU, NULL, 2, WebSetCmds }, |
| #endif |
#endif |
| { "user {name} {password} [{priv}]", "Add console user" , |
{ "user {name} {password} [{priv}]", "Add console user" , |
| UserCommand, NULL, 2, NULL }, |
UserCommand, NULL, 2, NULL }, |
| { "global ...", "Global settings", |
{ "global ...", "Global settings", |
| CMD_SUBMENU, NULL, 2, (void *) GlobalSetCmds }, | CMD_SUBMENU, NULL, 2, GlobalSetCmds }, |
| #ifdef USE_NG_NETFLOW |
#ifdef USE_NG_NETFLOW |
| { "netflow ...", "NetFlow settings", |
{ "netflow ...", "NetFlow settings", |
| CMD_SUBMENU, NULL, 2, (void *) NetflowSetCmds }, | CMD_SUBMENU, NULL, 2, NetflowSetCmds }, |
| #endif |
#endif |
| #ifdef USE_NG_NAT |
#ifdef USE_NG_NAT |
| { "nat ...", "Nat settings", |
{ "nat ...", "Nat settings", |
| CMD_SUBMENU, NULL, 2, (void *) NatSetCmds }, | CMD_SUBMENU, NULL, 2, NatSetCmds }, |
| #endif |
#endif |
| { "debug level", "Set netgraph debug level", |
{ "debug level", "Set netgraph debug level", |
| SetDebugCommand, NULL, 2, NULL }, |
SetDebugCommand, NULL, 2, NULL }, |
| #define _WANT_DEVICE_CMDS |
#define _WANT_DEVICE_CMDS |
| #include "devices.h" |
#include "devices.h" |
| { NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
| }; |
}; |
| |
|
| 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 }, |
| { "close [{layer}]", "Close a layer", |
{ "close [{layer}]", "Close a layer", |
| CloseCommand, NULL, 1, NULL }, |
CloseCommand, NULL, 1, NULL }, |
| { "create ...", "Create new item", |
{ "create ...", "Create new item", |
| CMD_SUBMENU, NULL, 2, (void *) CreateCommands }, | CMD_SUBMENU, NULL, 2, CreateCommands }, |
| { "destroy ...", "Destroy item", |
{ "destroy ...", "Destroy item", |
| CMD_SUBMENU, NULL, 2, (void *) DestroyCommands }, | CMD_SUBMENU, NULL, 2, DestroyCommands }, |
| { "exit", "Exit console", |
{ "exit", "Exit console", |
| ExitCommand, NULL, 0, NULL }, |
ExitCommand, NULL, 0, NULL }, |
| { "iface {iface}", "Choose bundle by iface", |
{ "iface {iface}", "Choose bundle by iface", |
|
Line 362
|
Line 393
|
| 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 }, |
| { "session {sesid}", "Choose link by session-id", |
{ "session {sesid}", "Choose link by session-id", |
| SessionCommand, NULL, 0, NULL }, |
SessionCommand, NULL, 0, NULL }, |
| { "set ...", "Set parameters", |
{ "set ...", "Set parameters", |
| CMD_SUBMENU, NULL, 0, (void *) SetCommands }, | CMD_SUBMENU, NULL, 0, SetCommands }, |
| | { "unset ...", "Unset parameters", |
| | CMD_SUBMENU, NULL, 0, UnSetCommands }, |
| { "show ...", "Show status", |
{ "show ...", "Show status", |
| CMD_SUBMENU, NULL, 0, (void *) ShowCommands }, | CMD_SUBMENU, NULL, 0, ShowCommands }, |
| { NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
| }; |
}; |
| |
|
| |
|
|
Line 381
|
Line 414
|
| * Layers |
* Layers |
| */ |
*/ |
| |
|
| struct layer gLayers[] = { | static struct layer gLayers[] = { |
| { "iface", |
{ "iface", |
| IfaceOpenCmd, |
IfaceOpenCmd, |
| IfaceCloseCmd, |
IfaceCloseCmd, |
|
Line 441
|
Line 474
|
| */ |
*/ |
| |
|
| int |
int |
| DoCommand(Context ctx, int ac, char *av[], const char *file, int line) | DoCommand(Context ctx, int ac, const char *const av[], const char *file, int line) |
| { |
{ |
| int rtn, i; |
int rtn, i; |
| char filebuf[100], cmd[256]; |
char filebuf[100], cmd[256]; |
|
Line 505 DoCommand(Context ctx, int ac, char *av[], const char
|
Line 538 DoCommand(Context ctx, int ac, char *av[], const char
|
| */ |
*/ |
| |
|
| int |
int |
| DoCommandTab(Context ctx, CmdTab cmdlist, int ac, char *av[]) | DoCommandTab(Context ctx, CmdTab cmdlist, int ac, const char *const av[]) |
| { |
{ |
| CmdTab cmd; |
CmdTab cmd; |
| int rtn = 0; |
int rtn = 0; |
|
Line 542 DoCommandTab(Context ctx, CmdTab cmdlist, int ac, char
|
Line 575 DoCommandTab(Context ctx, CmdTab cmdlist, int ac, char
|
| */ |
*/ |
| |
|
| int |
int |
| FindCommand(Context ctx, CmdTab cmds, char *str, CmdTab *cmdp) | FindCommand(Context ctx, CmdTab cmds, const char *str, CmdTab *cmdp) |
| { |
{ |
| int nmatch; |
int nmatch; |
| int len = strlen(str); |
int len = strlen(str); |
|
Line 572 FindCommand(Context ctx, CmdTab cmds, char *str, CmdTa
|
Line 605 FindCommand(Context ctx, CmdTab cmds, char *str, CmdTa
|
| */ |
*/ |
| |
|
| static int |
static int |
| GlobalSetCommand(Context ctx, int ac, char *av[], void *arg) | GlobalSetCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| int val; |
int val; |
| |
|
|
Line 652 GlobalSetCommand(Context ctx, int ac, char *av[], void
|
Line 685 GlobalSetCommand(Context ctx, int ac, char *av[], void
|
| if (val < 0 || val > 65536) |
if (val < 0 || val > 65536) |
| Error("Incorrect L2TP call limit"); |
Error("Incorrect L2TP call limit"); |
| else |
else |
| gL2TPtunlimit = val; | gL2TPtunlimit = (unsigned)val; |
| break; |
break; |
| #endif |
#endif |
| |
|
|
Line 670 GlobalSetCommand(Context ctx, int ac, char *av[], void
|
Line 703 GlobalSetCommand(Context ctx, int ac, char *av[], void
|
| if (val <= 0 || val > 65536) |
if (val <= 0 || val > 65536) |
| Error("Incorrect PPTP call limit"); |
Error("Incorrect PPTP call limit"); |
| else |
else |
| gPPTPtunlimit = val; | gPPTPtunlimit = (unsigned)val; |
| break; |
break; |
| #endif |
#endif |
| |
|
|
Line 734 GlobalSetCommand(Context ctx, int ac, char *av[], void
|
Line 767 GlobalSetCommand(Context ctx, int ac, char *av[], void
|
| break; |
break; |
| #endif /* USE_NG_BPF */ |
#endif /* USE_NG_BPF */ |
| |
|
| |
case SET_QTHRESHOLD: |
| |
if (ac == 2) { |
| |
int val_max; |
| |
|
| |
val = atoi(av[0]); |
| |
if (val < 0 || val >= MSG_QUEUE_LEN-1) |
| |
Error("Incorrect minimum threshold for message queue, " |
| |
"must be between 0 and %d", MSG_QUEUE_LEN-1); |
| |
val_max = atoi(av[1]); |
| |
if (val_max <= val || val_max >= MSG_QUEUE_LEN) |
| |
Error("Incorrect maximum threshold for message queue, " |
| |
"must be greater than minimum and less than %d", |
| |
MSG_QUEUE_LEN); |
| |
gQThresMin = val; |
| |
gQThresMax = val_max; |
| |
gQThresDiff = val_max - val; |
| |
} |
| |
else |
| |
return (-1); |
| |
break; |
| default: |
default: |
| return(-1); |
return(-1); |
| } |
} |
|
Line 746 GlobalSetCommand(Context ctx, int ac, char *av[], void
|
Line 799 GlobalSetCommand(Context ctx, int ac, char *av[], void
|
| */ |
*/ |
| |
|
| int |
int |
| HelpCommand(Context ctx, int ac, char *av[], void *arg) | HelpCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| int depth, i; |
int depth, i; |
| CmdTab menu, cmd; |
CmdTab menu, cmd; |
|
Line 769 HelpCommand(Context ctx, int ac, char *av[], void *arg
|
Line 822 HelpCommand(Context ctx, int ac, char *av[], void *arg
|
| else |
else |
| errfmt = "%sUnknown command: '%s'.\r\n"; |
errfmt = "%sUnknown command: '%s'.\r\n"; |
| if (arg) { |
if (arg) { |
| Printf(errfmt, (char*)arg, buf); | Printf(errfmt, (const char*)arg, buf); |
| } else { |
} else { |
| Printf(errfmt, "", buf); |
Printf(errfmt, "", buf); |
| } |
} |
|
Line 813 HelpCommand(Context ctx, int ac, char *av[], void *arg
|
Line 866 HelpCommand(Context ctx, int ac, char *av[], void *arg
|
| */ |
*/ |
| |
|
| static int |
static int |
| SetDebugCommand(Context ctx, int ac, char *av[], void *arg) | SetDebugCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| |
(void)arg; |
| |
(void)ctx; |
| |
|
| switch (ac) { |
switch (ac) { |
| case 1: |
case 1: |
| NgSetDebug(atoi(av[0])); |
NgSetDebug(atoi(av[0])); |
|
Line 830 SetDebugCommand(Context ctx, int ac, char *av[], void
|
Line 886 SetDebugCommand(Context ctx, int ac, char *av[], void
|
| */ |
*/ |
| |
|
| static int |
static int |
| ShowVersion(Context ctx, int ac, char *av[], void *arg) | ShowVersion(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| |
(void)ac; |
| |
(void)av; |
| |
(void)arg; |
| |
|
| Printf("MPD version: %s\r\n", gVersion); |
Printf("MPD version: %s\r\n", gVersion); |
| Printf(" Available features:\r\n"); |
Printf(" Available features:\r\n"); |
| #ifdef USE_IPFW |
#ifdef USE_IPFW |
|
Line 844 ShowVersion(Context ctx, int ac, char *av[], void *arg
|
Line 904 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 883 ShowVersion(Context ctx, int ac, char *av[], void *arg
|
Line 948 ShowVersion(Context ctx, int ac, char *av[], void *arg
|
| #endif |
#endif |
| #ifdef USE_NG_NETFLOW |
#ifdef USE_NG_NETFLOW |
| Printf(" ng_netflow : yes\r\n"); |
Printf(" ng_netflow : yes\r\n"); |
| |
#if NGM_NETFLOW_COOKIE >= 1309868867 |
| |
Printf(" netflow v9 : yes\r\n"); |
| #else |
#else |
| |
Printf(" netflow v9 : no\r\n"); |
| |
#endif |
| |
#else |
| Printf(" ng_netflow : no\r\n"); |
Printf(" ng_netflow : no\r\n"); |
| #endif |
#endif |
| #ifdef USE_NG_PRED1 |
#ifdef USE_NG_PRED1 |
|
Line 904 ShowVersion(Context ctx, int ac, char *av[], void *arg
|
Line 974 ShowVersion(Context ctx, int ac, char *av[], void *arg
|
| */ |
*/ |
| |
|
| static int |
static int |
| ShowEvents(Context ctx, int ac, char *av[], void *arg) | ShowEvents(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| EventDump(ctx, "mpd events"); | (void)ac; |
| | (void)av; |
| | (void)arg; |
| | |
| | EventDump(ctx); |
| return(0); |
return(0); |
| } |
} |
| |
|
|
Line 915 ShowEvents(Context ctx, int ac, char *av[], void *arg)
|
Line 989 ShowEvents(Context ctx, int ac, char *av[], void *arg)
|
| */ |
*/ |
| |
|
| static int |
static int |
| ShowGlobal(Context ctx, int ac, char *av[], void *arg) | ShowGlobal(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| #ifdef USE_NG_BPF |
#ifdef USE_NG_BPF |
| int k; |
int k; |
| #endif |
#endif |
| |
|
| |
(void)ac; |
| |
(void)av; |
| |
(void)arg; |
| |
|
| Printf("Global settings:\r\n"); |
Printf("Global settings:\r\n"); |
| #ifdef USE_IPFW |
#ifdef USE_IPFW |
| Printf(" startrule : %d\r\n", rule_pool_start); |
Printf(" startrule : %d\r\n", rule_pool_start); |
|
Line 930 ShowGlobal(Context ctx, int ac, char *av[], void *arg)
|
Line 1008 ShowGlobal(Context ctx, int ac, char *av[], void *arg)
|
| #endif |
#endif |
| #ifdef PHYSTYPE_L2TP |
#ifdef PHYSTYPE_L2TP |
| Printf(" l2tptimeout : %d\r\n", gL2TPto); |
Printf(" l2tptimeout : %d\r\n", gL2TPto); |
| Printf(" l2tplimit : %d\r\n", gL2TPtunlimit); | Printf(" l2tplimit : %u\r\n", gL2TPtunlimit); |
| #endif |
#endif |
| #ifdef PHYSTYPE_PPTP |
#ifdef PHYSTYPE_PPTP |
| Printf(" pptptimeout : %d\r\n", gPPTPto); |
Printf(" pptptimeout : %d\r\n", gPPTPto); |
| Printf(" pptplimit : %d\r\n", gPPTPtunlimit); | Printf(" pptplimit : %u\r\n", gPPTPtunlimit); |
| #endif |
#endif |
| Printf(" max-children : %d\r\n", gMaxChildren); |
Printf(" max-children : %d\r\n", gMaxChildren); |
| |
Printf(" qthreshold : %d %d\r\n", gQThresMin, gQThresMax); |
| Printf("Global options:\r\n"); |
Printf("Global options:\r\n"); |
| OptStat(ctx, &gGlobalConf.options, gGlobalConfList); |
OptStat(ctx, &gGlobalConf.options, gGlobalConfList); |
| #ifdef USE_NG_BPF |
#ifdef USE_NG_BPF |
|
Line 949 ShowGlobal(Context ctx, int ac, char *av[], void *arg)
|
Line 1028 ShowGlobal(Context ctx, int ac, char *av[], void *arg)
|
| } |
} |
| } |
} |
| #endif |
#endif |
| |
Printf("Global state:\r\n"); |
| |
Printf(" children : %d\r\n", gChildren); |
| return 0; |
return 0; |
| } |
} |
| |
|
|
Line 958 ShowGlobal(Context ctx, int ac, char *av[], void *arg)
|
Line 1039 ShowGlobal(Context ctx, int ac, char *av[], void *arg)
|
| */ |
*/ |
| |
|
| static int |
static int |
| ExitCommand(Context ctx, int ac, char *av[], void *arg) | ExitCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| |
|
| |
(void)ac; |
| |
(void)av; |
| |
(void)arg; |
| |
|
| if (ctx->cs) |
if (ctx->cs) |
| ctx->cs->exit = TRUE; |
ctx->cs->exit = TRUE; |
| return(0); |
return(0); |
|
Line 970 ExitCommand(Context ctx, int ac, char *av[], void *arg
|
Line 1056 ExitCommand(Context ctx, int ac, char *av[], void *arg
|
| */ |
*/ |
| |
|
| static int |
static int |
| QuitCommand(Context ctx, int ac, char *av[], void *arg) | QuitCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| |
(void)ac; |
| |
(void)av; |
| |
(void)arg; |
| |
|
| if (ctx->cs) |
if (ctx->cs) |
| ctx->cs->exit = TRUE; |
ctx->cs->exit = TRUE; |
| SendSignal(SIGTERM); |
SendSignal(SIGTERM); |
|
Line 983 QuitCommand(Context ctx, int ac, char *av[], void *arg
|
Line 1073 QuitCommand(Context ctx, int ac, char *av[], void *arg
|
| */ |
*/ |
| |
|
| static int |
static int |
| LoadCommand(Context ctx, int ac, char *av[], void *arg) | LoadCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| char filename[128]; |
char filename[128]; |
| #ifdef USE_FETCH |
#ifdef USE_FETCH |
|
Line 993 LoadCommand(Context ctx, int ac, char *av[], void *arg
|
Line 1083 LoadCommand(Context ctx, int ac, char *av[], void *arg
|
| int fetch = 0; |
int fetch = 0; |
| #endif |
#endif |
| |
|
| |
(void)arg; |
| if (ac < 1 || ac > 2) |
if (ac < 1 || ac > 2) |
| return(-1); |
return(-1); |
| else { |
else { |
|
Line 1049 out: if (fetch)
|
Line 1140 out: if (fetch)
|
| */ |
*/ |
| |
|
| static int |
static int |
| OpenCommand(Context ctx, int ac, char *av[], void *arg) | OpenCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| Layer layer; |
Layer layer; |
| const char *name; |
const char *name; |
| |
|
| |
(void)arg; |
| switch (ac) { |
switch (ac) { |
| case 0: |
case 0: |
| name = DEFAULT_OPEN_LAYER; |
name = DEFAULT_OPEN_LAYER; |
|
Line 1079 OpenCommand(Context ctx, int ac, char *av[], void *arg
|
Line 1171 OpenCommand(Context ctx, int ac, char *av[], void *arg
|
| */ |
*/ |
| |
|
| static int |
static int |
| CloseCommand(Context ctx, int ac, char *av[], void *arg) | CloseCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| Layer layer; |
Layer layer; |
| const char *name; |
const char *name; |
| |
|
| |
(void)arg; |
| switch (ac) { |
switch (ac) { |
| case 0: |
case 0: |
| name = DEFAULT_OPEN_LAYER; |
name = DEFAULT_OPEN_LAYER; |
|
Line 1111 CloseCommand(Context ctx, int ac, char *av[], void *ar
|
Line 1204 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 1136 GetLayer(const char *name)
|
Line 1230 GetLayer(const char *name)
|
| */ |
*/ |
| |
|
| static int |
static int |
| ShowLayers(Context ctx, int ac, char *av[], void *arg) | ShowLayers(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| int k; | size_t k; |
| |
|
| |
(void)ac; |
| |
(void)av; |
| |
(void)arg; |
| |
|
| Printf("\tName\t\tDescription\r\n"); |
Printf("\tName\t\tDescription\r\n"); |
| Printf("\t----\t\t-----------\r\n"); |
Printf("\t----\t\t-----------\r\n"); |
| for (k = 0; k < NUM_LAYERS; k++) |
for (k = 0; k < NUM_LAYERS; k++) |
|
Line 1152 ShowLayers(Context ctx, int ac, char *av[], void *arg)
|
Line 1250 ShowLayers(Context ctx, int ac, char *av[], void *arg)
|
| */ |
*/ |
| |
|
| static int |
static int |
| ShowTypes(Context ctx, int ac, char *av[], void *arg) | ShowTypes(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| PhysType pt; | const struct phystype *pt; |
| int k; |
int k; |
| |
|
| |
(void)ac; |
| |
(void)av; |
| |
(void)arg; |
| |
|
| Printf("\tName\t\tDescription\r\n"); |
Printf("\tName\t\tDescription\r\n"); |
| Printf("\t----\t\t-----------\r\n"); |
Printf("\t----\t\t-----------\r\n"); |
| for (k = 0; (pt = gPhysTypes[k]); k++) |
for (k = 0; (pt = gPhysTypes[k]); k++) |
|
Line 1169 ShowTypes(Context ctx, int ac, char *av[], void *arg)
|
Line 1271 ShowTypes(Context ctx, int ac, char *av[], void *arg)
|
| */ |
*/ |
| |
|
| static int |
static int |
| ShowSummary(Context ctx, int ac, char *av[], void *arg) | ShowSummary(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| int b, l, f; |
int b, l, f; |
| Bund B; |
Bund B; |
|
Line 1177 ShowSummary(Context ctx, int ac, char *av[], void *arg
|
Line 1279 ShowSummary(Context ctx, int ac, char *av[], void *arg
|
| Rep R; |
Rep R; |
| char buf[64]; |
char buf[64]; |
| |
|
| |
(void)ac; |
| |
(void)av; |
| |
(void)arg; |
| |
|
| Printf("Current daemon status summary\r\n"); |
Printf("Current daemon status summary\r\n"); |
| Printf("Iface\tBund\t\tLink\tLCP\tDevice\t\tUser\t\tFrom\r\n"); |
Printf("Iface\tBund\t\tLink\tLCP\tDevice\t\tUser\t\tFrom\r\n"); |
| for (b = 0; b<gNumLinks; b++) { |
for (b = 0; b<gNumLinks; b++) { |
|
Line 1255 ShowSummary(Context ctx, int ac, char *av[], void *arg
|
Line 1361 ShowSummary(Context ctx, int ac, char *av[], void *arg
|
| */ |
*/ |
| |
|
| static int |
static int |
| ShowSessions(Context ctx, int ac, char *av[], void *arg) | ShowSessions(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| 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 1314 ShowSessions(Context ctx, int ac, char *av[], void *ar
|
Line 1420 ShowSessions(Context ctx, int ac, char *av[], void *ar
|
| case SHOW_PEER: |
case SHOW_PEER: |
| if (strcmp(av[0], peer)) |
if (strcmp(av[0], peer)) |
| continue; |
continue; |
| break; | break; |
| default: |
default: |
| return (-1); |
return (-1); |
| } |
} |
|
Line 1328 out:
|
Line 1434 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 1339 out:
|
Line 1453 out:
|
| */ |
*/ |
| |
|
| static int |
static int |
| ShowCustomer(Context ctx, int ac, char *av[], void *arg) | ShowCustomer(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| Link l = ctx->lnk; |
Link l = ctx->lnk; |
| Bund b = ctx->bund; |
Bund b = ctx->bund; |
|
Line 1351 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1465 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
| struct acl *a; |
struct acl *a; |
| #endif |
#endif |
| |
|
| |
(void)ac; |
| |
(void)av; |
| |
(void)arg; |
| |
|
| if (b && b->iface.ifname[0]) { |
if (b && b->iface.ifname[0]) { |
| iface = &b->iface; |
iface = &b->iface; |
| Printf("Interface:\r\n"); |
Printf("Interface:\r\n"); |
|
Line 1379 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1497 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 1396 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1514 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 1405 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1523 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 1415 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1533 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 1429 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1547 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 1437 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1555 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; |
| } |
} |
|
Line 1479 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1597 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
| else if (j != 0) |
else if (j != 0) |
| l = NULL; |
l = NULL; |
| if (l) { |
if (l) { |
| char buf[64]; |
|
| Printf("Link %s:\r\n", l->name); |
Printf("Link %s:\r\n", l->name); |
| Printf("\tDevice type : %s\r\n", l->type?l->type->name:""); |
Printf("\tDevice type : %s\r\n", l->type?l->type->name:""); |
| Printf("\tStatus : %s/%s\r\n", |
Printf("\tStatus : %s/%s\r\n", |
|
Line 1530 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
Line 1647 ShowCustomer(Context ctx, int ac, char *av[], void *ar
|
| int |
int |
| AdmitBund(Context ctx, CmdTab cmd) |
AdmitBund(Context ctx, CmdTab cmd) |
| { |
{ |
| |
(void)cmd; |
| if (!ctx->bund) |
if (!ctx->bund) |
| return(FALSE); |
return(FALSE); |
| return(TRUE); |
return(TRUE); |
|
Line 1542 AdmitBund(Context ctx, CmdTab cmd)
|
Line 1660 AdmitBund(Context ctx, CmdTab cmd)
|
| int |
int |
| AdmitLink(Context ctx, CmdTab cmd) |
AdmitLink(Context ctx, CmdTab cmd) |
| { |
{ |
| |
(void)cmd; |
| if (!ctx->lnk) |
if (!ctx->lnk) |
| return(FALSE); |
return(FALSE); |
| return(TRUE); |
return(TRUE); |
|
Line 1554 AdmitLink(Context ctx, CmdTab cmd)
|
Line 1673 AdmitLink(Context ctx, CmdTab cmd)
|
| int |
int |
| AdmitRep(Context ctx, CmdTab cmd) |
AdmitRep(Context ctx, CmdTab cmd) |
| { |
{ |
| |
(void)cmd; |
| if (!ctx->rep) |
if (!ctx->rep) |
| return(FALSE); |
return(FALSE); |
| return(TRUE); |
return(TRUE); |