Date: Wed, 24 Nov 1999 06:02:17 -0800 (PST) From: sobomax@altavista.net To: freebsd-gnats-submit@freebsd.org Subject: bin/15073: [PATCH] additional command for user-level ppp to show urgent (prioritized) ports Message-ID: <19991124140217.6D69E150E5@hub.freebsd.org>
index | next in thread | raw e-mail
>Number: 15073
>Category: bin
>Synopsis: [PATCH] additional command for user-level ppp to show urgent (prioritized) ports
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Nov 24 06:10:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator: Maxim Sobolev
>Release: 4.0-CURRENT
>Organization:
Vega International Capital
>Environment:
>Description:
This small patch allows to inspect which ports in the ppp are urgent (i.e. prioretized).
>How-To-Repeat:
>Fix:
diff -ruN /usr/current/src/usr.sbin/ppp/command.c ppp/command.c
--- /usr/current/src/usr.sbin/ppp/command.c Thu Nov 18 10:32:06 1999
+++ ppp/command.c Wed Nov 24 15:46:27 1999
@@ -752,6 +752,16 @@
return 0;
}
+static int
+ShowUrgent(struct cmdargs const *arg)
+{
+ prompt_Printf(arg->prompt,"TCP:\n");
+ ipcp_ListUrgentTcpPorts(&arg->bundle->ncp.ipcp, arg->prompt);
+ prompt_Printf(arg->prompt,"\nUDP:\n");
+ ipcp_ListUrgentUdpPorts(&arg->bundle->ncp.ipcp, arg->prompt);
+ return 0;
+}
+
static struct cmdtab const ShowCommands[] = {
{"bundle", NULL, bundle_ShowStatus, LOCAL_AUTH,
"bundle details", "show bundle"},
@@ -793,6 +803,8 @@
"STOPPED timeout", "show stopped"},
{"timers", NULL, ShowTimerList, LOCAL_AUTH,
"alarm timers", "show timers"},
+ {"urgent", NULL, ShowUrgent, LOCAL_AUTH,
+ "urgent ports", "show urgent"},
{"version", NULL, ShowVersion, LOCAL_NO_AUTH | LOCAL_AUTH,
"version string", "show version"},
{"who", NULL, log_ShowWho, LOCAL_AUTH,
diff -ruN /usr/current/src/usr.sbin/ppp/ipcp.c ppp/ipcp.c
--- /usr/current/src/usr.sbin/ppp/ipcp.c Wed Sep 22 06:49:15 1999
+++ ppp/ipcp.c Wed Nov 24 15:57:02 1999
@@ -119,6 +119,15 @@
}
void
+ipcp_ListUrgentPorts(struct port_range *range, struct prompt *prompt)
+{
+ int f;
+
+ for (f = 0; f < range->nports; f++)
+ prompt_Printf(prompt, " %d\n", range->port[f]);
+}
+
+void
ipcp_AddUrgentPort(struct port_range *range, u_short port)
{
u_short *newport;
diff -ruN /usr/current/src/usr.sbin/ppp/ipcp.h ppp/ipcp.h
--- /usr/current/src/usr.sbin/ppp/ipcp.h Wed Sep 8 09:09:02 1999
+++ ppp/ipcp.h Wed Nov 24 15:46:27 1999
@@ -129,6 +129,7 @@
extern void ipcp_CleanInterface(struct ipcp *);
extern int ipcp_InterfaceUp(struct ipcp *);
extern int ipcp_IsUrgentPort(struct port_range *, u_short, u_short);
+extern void ipcp_ListUrgentPorts(struct port_range *, struct prompt *);
extern void ipcp_AddUrgentPort(struct port_range *, u_short);
extern void ipcp_RemoveUrgentPort(struct port_range *, u_short);
extern void ipcp_ClearUrgentPorts(struct port_range *);
@@ -138,6 +139,10 @@
ipcp_IsUrgentPort(&(ipcp)->cfg.urgent.tcp, p1, p2)
#define ipcp_IsUrgentUdpPort(ipcp, p1, p2) \
ipcp_IsUrgentPort(&(ipcp)->cfg.urgent.udp, p1, p2)
+#define ipcp_ListUrgentTcpPorts(ipcp, p) \
+ ipcp_ListUrgentPorts(&(ipcp)->cfg.urgent.tcp, p);
+#define ipcp_ListUrgentUdpPorts(ipcp, p) \
+ ipcp_ListUrgentPorts(&(ipcp)->cfg.urgent.udp, p);
#define ipcp_AddUrgentTcpPort(ipcp, p) \
ipcp_AddUrgentPort(&(ipcp)->cfg.urgent.tcp, p)
#define ipcp_AddUrgentUdpPort(ipcp, p) \
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991124140217.6D69E150E5>
