From fefb5c4b89b5ffc87cfeed0e37c7a423053677a9 Mon Sep 17 00:00:00 2001 From: zhanglianghy Date: Thu, 18 Aug 2022 16:11:06 +0800 Subject: [PATCH] =?UTF-8?q?OCT:=E5=A2=9E=E5=8A=A0port=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l2tp/pppd/pppd/plugins/pppol2tp/nt_msg.h | 2 ++ l2tp/pppd/pppd/plugins/pppol2tp/pppnotify.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/l2tp/pppd/pppd/plugins/pppol2tp/nt_msg.h b/l2tp/pppd/pppd/plugins/pppol2tp/nt_msg.h index e6ec381..786a704 100644 --- a/l2tp/pppd/pppd/plugins/pppol2tp/nt_msg.h +++ b/l2tp/pppd/pppd/plugins/pppol2tp/nt_msg.h @@ -20,6 +20,8 @@ typedef struct _notify_msg { int remote_tunnel; int local_session; int remote_session; + int local_port; + int remote_port; struct in_addr local_addr; struct in_addr remote_addr; struct in_addr va_addr; diff --git a/l2tp/pppd/pppd/plugins/pppol2tp/pppnotify.c b/l2tp/pppd/pppd/plugins/pppol2tp/pppnotify.c index 83227a3..a0526b4 100644 --- a/l2tp/pppd/pppd/plugins/pppol2tp/pppnotify.c +++ b/l2tp/pppd/pppd/plugins/pppol2tp/pppnotify.c @@ -117,6 +117,8 @@ char* notify_format_cjson(notify_msg_t *msg, char *remote_addr, char*local_addr) cJSON_AddNumberToObject(cjson_params, "remote_tunnel", msg->remote_tunnel); cJSON_AddNumberToObject(cjson_params, "local_session", msg->local_session); cJSON_AddNumberToObject(cjson_params, "remote_session", msg->remote_session); + cJSON_AddNumberToObject(cjson_params, "local_port", msg->local_port); + cJSON_AddNumberToObject(cjson_params, "remote_port", msg->remote_port); cJSON_AddStringToObject(cjson_params, "local_addr", local_addr); cJSON_AddStringToObject(cjson_params, "remote_addr", remote_addr); cJSON_AddStringToObject(cjson_params, "va_addr", inet_ntoa(msg->va_addr)); @@ -155,6 +157,8 @@ int notify_ppp_status(char *remote, char*local, int status) msg.remote_tunnel = remote_tunnel_id; msg.local_session = pppol2tp_session_id; msg.remote_session = remote_session_id; + msg.local_port = local_port; + msg.remote_port = remote_port; //inet_aton(local, &msg.local_addr); //inet_aton(remote, &msg.remote_addr);