aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/nat_cmd.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-03-07 15:02:38 +0000
committerBrian Somers <brian@FreeBSD.org>1999-03-07 15:02:38 +0000
commitd318fe8e170bd30b09d84207c2de6a1b45f53146 (patch)
treebaffec1d24d3f18a34a5896232aba65f4f01848a /usr.sbin/ppp/nat_cmd.c
parentac8e3334de328c09a7b00ed25b6347a8ad8302da (diff)
Notes
Diffstat (limited to 'usr.sbin/ppp/nat_cmd.c')
-rw-r--r--usr.sbin/ppp/nat_cmd.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c
index 3a86a8e7aed9f..2c11e085b7c05 100644
--- a/usr.sbin/ppp/nat_cmd.c
+++ b/usr.sbin/ppp/nat_cmd.c
@@ -2,7 +2,7 @@
* The code in this file was written by Eivind Eklund <perhaps@yes.no>,
* who places it in the public domain without restriction.
*
- * $Id: alias_cmd.c,v 1.18 1998/09/17 00:45:25 brian Exp $
+ * $Id: alias_cmd.c,v 1.19 1999/01/28 01:56:30 brian Exp $
*/
#include <sys/param.h>
@@ -216,3 +216,26 @@ StrToAddrAndPort(const char *str, struct in_addr *addr, u_short *port, const cha
return StrToPort(colon+1, port, proto);
}
+
+int
+alias_ProxyRule(struct cmdargs const *arg)
+{
+ char cmd[LINE_LEN];
+ int f, pos;
+ size_t len;
+
+ if (arg->argn >= arg->argc)
+ return -1;
+
+ for (f = arg->argn, pos = 0; f < arg->argc; f++) {
+ len = strlen(arg->argv[f]);
+ if (sizeof cmd - pos < len + (f ? 1 : 0))
+ break;
+ if (f)
+ cmd[pos++] = ' ';
+ strcpy(cmd + pos, arg->argv[f]);
+ pos += len;
+ }
+
+ return PacketAliasProxyRule(cmd);
+}