Page MenuHome Accel-ppp

accelppp-add-uplinkif-to-show-sessions.patch

Authored By
micron
Jan 4 2022, 09:46
Size
2 KB
Referenced Files
None
Subscribers
None

accelppp-add-uplinkif-to-show-sessions.patch

diff -rNup accel-ppp-master.orig/accel-pppd/cli/show_sessions.c accel-ppp-master/accel-pppd/cli/show_sessions.c
--- accel-ppp-master.orig/accel-pppd/cli/show_sessions.c 2022-01-04 08:03:12.982252840 +0000
+++ accel-ppp-master/accel-pppd/cli/show_sessions.c 2022-01-04 08:02:21.323089118 +0000
@@ -17,7 +17,7 @@
#include "memdebug.h"
#define CELL_SIZE 128
-#define DEF_COLUMNS "ifname,username,calling-sid,ip,rate-limit,type,comp,state,uptime"
+#define DEF_COLUMNS "ifname,uplinkif,username,calling-sid,ip,rate-limit,type,comp,state,uptime"
struct column_t
{
@@ -509,6 +509,11 @@ static void print_uptime_raw(struct ap_s
sprintf(buf, "%lu", (unsigned long)uptime);
}
+static void print_uplinkif(struct ap_session *ses, char *buf)
+{
+ snprintf(buf, CELL_SIZE, "%s", ses->ctrl->uplinkif_id);
+}
+
static void print_calling_sid(struct ap_session *ses, char *buf)
{
snprintf(buf, CELL_SIZE, "%s", ses->ctrl->calling_station_id);
@@ -650,6 +655,7 @@ static void init(void)
cli_show_ses_register("netns", "network namespace name", print_netns);
cli_show_ses_register("ifname", "interface name", print_ifname);
+ cli_show_ses_register("uplinkif", "Uplink interface name", print_uplinkif);
cli_show_ses_register("username", "user name", print_username);
cli_show_ses_register("ip", "IP address", print_ip);
cli_show_ses_register("ip6", "IPv6 address", print_ip6);
diff -rNup accel-ppp-master.orig/accel-pppd/ctrl/pppoe/pppoe.c accel-ppp-master/accel-pppd/ctrl/pppoe/pppoe.c
--- accel-ppp-master.orig/accel-pppd/ctrl/pppoe/pppoe.c 2022-01-04 08:03:12.982252840 +0000
+++ accel-ppp-master/accel-pppd/ctrl/pppoe/pppoe.c 2022-01-04 08:01:16.392140714 +0000
@@ -212,6 +212,7 @@ static void disconnect(struct pppoe_conn
_free(conn->ctrl.calling_station_id);
_free(conn->ctrl.called_station_id);
+ _free(conn->ctrl.uplinkif_id);
_free(conn->service_name);
if (conn->host_uniq)
_free(conn->host_uniq);
@@ -362,6 +363,7 @@ static struct pppoe_conn_t *allocate_cha
conn->ctrl.name = "pppoe";
conn->ctrl.ifname = serv->ifname;
conn->ctrl.mppe = conf_mppe;
+ conn->ctrl.uplinkif_id = _strdup(serv->ifname);
if (ppp_max_payload > ETH_DATA_LEN - 8)
conn->ctrl.max_mtu = min(ppp_max_payload, serv->mtu - 8);
diff -rNup accel-ppp-master.orig/accel-pppd/include/ap_session.h accel-ppp-master/accel-pppd/include/ap_session.h
--- accel-ppp-master.orig/accel-pppd/include/ap_session.h 2022-01-04 08:03:12.982252840 +0000
+++ accel-ppp-master/accel-pppd/include/ap_session.h 2022-01-04 08:01:16.392140714 +0000
@@ -51,6 +51,7 @@ struct ap_ctrl {
int mppe;
char *calling_station_id;
char *called_station_id;
+ char *uplinkif_id;
unsigned int dont_ifcfg:1;
unsigned int ppp:1;
unsigned int ppp_npmode:2;

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/nc/ln/lbslc4pbchhoplxu
Default Alt Text
accelppp-add-uplinkif-to-show-sessions.patch (2 KB)

Event Timeline