summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/nat_cmd.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-03-07 15:02:38 +0000
committerbrian <brian@FreeBSD.org>1999-03-07 15:02:38 +0000
commit121ec0cce66ec860abef535b8f62d1bddb4e0c85 (patch)
tree0b34de9f3a4509264f8524780f736217e7fcc4c3 /usr.sbin/ppp/nat_cmd.c
parent1b7dfc80704fcc1053303fab23f411f404a7e856 (diff)
downloadFreeBSD-src-121ec0cce66ec860abef535b8f62d1bddb4e0c85.zip
FreeBSD-src-121ec0cce66ec860abef535b8f62d1bddb4e0c85.tar.gz
Support proxying & transparent proxying curtesy of libalias(3).
Order the alias command descriptions. Order the SEE ALSO entries.
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 3a86a8e..2c11e08 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);
+}
OpenPOWER on IntegriCloud