From 121ec0cce66ec860abef535b8f62d1bddb4e0c85 Mon Sep 17 00:00:00 2001 From: brian Date: Sun, 7 Mar 1999 15:02:38 +0000 Subject: Support proxying & transparent proxying curtesy of libalias(3). Order the alias command descriptions. Order the SEE ALSO entries. --- usr.sbin/ppp/nat_cmd.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'usr.sbin/ppp/nat_cmd.c') 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 , * 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 @@ -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); +} -- cgit v1.1