summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2015-12-02 13:32:46 +0300
committerDmitry Kozlov <xeb@mail.ru>2015-12-02 13:32:46 +0300
commite493662216791794146087a0923839e6105241bf (patch)
tree039d03158e2843f9be3c7a84be407af100386247 /accel-pppd
parentb1c5ae767273119283089b35a79f1a64952234af (diff)
downloadaccel-ppp-e493662216791794146087a0923839e6105241bf.tar.gz
accel-ppp-e493662216791794146087a0923839e6105241bf.zip
ipoe: show sessions: intoduced new field ipoe-type to display type of session (up or dhcp)
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index e843b50..13709d0 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -2177,6 +2177,16 @@ static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt,
return CLI_CMD_OK;
}
+static void print_session_type(struct ap_session *s, char *buf)
+{
+ struct ipoe_session *ses = container_of(s, typeof(*ses), ses);
+
+ if (ses->UP)
+ strcpy(buf, "up");
+ else
+ strcpy(buf, "dhcp");
+}
+
void __export ipoe_get_stat(unsigned int **starting, unsigned int **active)
{
*starting = &stat_starting;
@@ -3450,6 +3460,7 @@ static void ipoe_init(void)
ipset_flush(conf_l4_redirect_ipset);
cli_register_simple_cmd2(show_stat_exec, NULL, 2, "show", "stat");
+ cli_show_ses_register("ipoe-type", "IPoE session type", print_session_type);
triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config);