Support PPTP via libalias (``alias pptp addr'').
This commit is contained in:
parent
164928d385
commit
50a63ab997
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=44557
@ -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.19 1999/01/28 01:56:30 brian Exp $
|
||||
* $Id: alias_cmd.c,v 1.20 1999/03/07 15:02:37 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -239,3 +239,27 @@ alias_ProxyRule(struct cmdargs const *arg)
|
||||
|
||||
return PacketAliasProxyRule(cmd);
|
||||
}
|
||||
|
||||
int
|
||||
alias_Pptp(struct cmdargs const *arg)
|
||||
{
|
||||
struct in_addr addr;
|
||||
|
||||
if (arg->argc == arg->argn) {
|
||||
addr.s_addr = INADDR_NONE;
|
||||
PacketAliasPptp(addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arg->argc != arg->argn + 1)
|
||||
return -1;
|
||||
|
||||
addr = GetIpAddr(arg->argv[arg->argn]);
|
||||
if (addr.s_addr == INADDR_NONE) {
|
||||
log_Printf(LogWARN, "%s: invalid address\n", arg->argv[arg->argn]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
PacketAliasPptp(addr);
|
||||
return 0;
|
||||
}
|
||||
|
@ -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.h,v 1.8 1998/05/21 21:43:45 brian Exp $
|
||||
* $Id: alias_cmd.h,v 1.9 1999/03/07 15:02:37 brian Exp $
|
||||
*/
|
||||
|
||||
struct cmdargs;
|
||||
@ -10,3 +10,4 @@ struct cmdargs;
|
||||
extern int alias_RedirectPort(struct cmdargs const *);
|
||||
extern int alias_RedirectAddr(struct cmdargs const *);
|
||||
extern int alias_ProxyRule(struct cmdargs const *);
|
||||
extern int alias_Pptp(struct cmdargs const *);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: command.c,v 1.186 1999/03/04 17:42:15 brian Exp $
|
||||
* $Id: command.c,v 1.187 1999/03/07 15:02:37 brian Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -141,7 +141,7 @@
|
||||
#define NEG_DNS 52
|
||||
|
||||
const char Version[] = "2.11";
|
||||
const char VersionDate[] = "$Date: 1999/03/04 17:42:15 $";
|
||||
const char VersionDate[] = "$Date: 1999/03/07 15:02:37 $";
|
||||
|
||||
static int ShowCommand(struct cmdargs const *);
|
||||
static int TerminalCommand(struct cmdargs const *);
|
||||
@ -554,6 +554,8 @@ static struct cmdtab const AliasCommands[] =
|
||||
(const void *) PKT_ALIAS_LOG},
|
||||
{"port", NULL, alias_RedirectPort, LOCAL_AUTH,
|
||||
"port redirection", "alias port [proto addr_local:port_local port_alias]"},
|
||||
{"pptp", NULL, alias_Pptp, LOCAL_AUTH,
|
||||
"Set the PPTP address", "alias pptp IP"},
|
||||
{"proxy", NULL, alias_ProxyRule, LOCAL_AUTH,
|
||||
"proxy control", "alias proxy server host[:port] ..."},
|
||||
{"same_ports", NULL, AliasOption, LOCAL_AUTH,
|
||||
|
@ -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.19 1999/01/28 01:56:30 brian Exp $
|
||||
* $Id: alias_cmd.c,v 1.20 1999/03/07 15:02:37 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -239,3 +239,27 @@ alias_ProxyRule(struct cmdargs const *arg)
|
||||
|
||||
return PacketAliasProxyRule(cmd);
|
||||
}
|
||||
|
||||
int
|
||||
alias_Pptp(struct cmdargs const *arg)
|
||||
{
|
||||
struct in_addr addr;
|
||||
|
||||
if (arg->argc == arg->argn) {
|
||||
addr.s_addr = INADDR_NONE;
|
||||
PacketAliasPptp(addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arg->argc != arg->argn + 1)
|
||||
return -1;
|
||||
|
||||
addr = GetIpAddr(arg->argv[arg->argn]);
|
||||
if (addr.s_addr == INADDR_NONE) {
|
||||
log_Printf(LogWARN, "%s: invalid address\n", arg->argv[arg->argn]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
PacketAliasPptp(addr);
|
||||
return 0;
|
||||
}
|
||||
|
@ -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.h,v 1.8 1998/05/21 21:43:45 brian Exp $
|
||||
* $Id: alias_cmd.h,v 1.9 1999/03/07 15:02:37 brian Exp $
|
||||
*/
|
||||
|
||||
struct cmdargs;
|
||||
@ -10,3 +10,4 @@ struct cmdargs;
|
||||
extern int alias_RedirectPort(struct cmdargs const *);
|
||||
extern int alias_RedirectAddr(struct cmdargs const *);
|
||||
extern int alias_ProxyRule(struct cmdargs const *);
|
||||
extern int alias_Pptp(struct cmdargs const *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $Id: ppp.8,v 1.155 1999/03/07 11:54:42 brian Exp $
|
||||
.\" $Id: ppp.8,v 1.156 1999/03/07 15:02:38 brian Exp $
|
||||
.Dd 20 September 1995
|
||||
.nr XX \w'\fC00'
|
||||
.Os FreeBSD
|
||||
@ -2681,6 +2681,29 @@ or
|
||||
and only connections of the given protocol
|
||||
are matched. This option is useful if you wish to run things like
|
||||
Internet phone on the machines behind your gateway.
|
||||
.It "alias pptp" Op Ar addr
|
||||
This tells
|
||||
.Nm
|
||||
to alias any
|
||||
.Em G Ns No eneral
|
||||
.Em R Ns No outing
|
||||
.Em E Ns No encapsulated
|
||||
.Pq Dv IPPROTO_GRE
|
||||
packets using
|
||||
.Ar addr
|
||||
rather than the local interface address. This allows the uses of the
|
||||
.Em P Ns No oint
|
||||
to
|
||||
.Em P Ns No oint
|
||||
.Em T Ns No unneling
|
||||
.Em P Ns No rotocol
|
||||
on a machine on the internal network.
|
||||
.Pp
|
||||
If
|
||||
.Ar addr
|
||||
is not specified,
|
||||
.Dv PPTP
|
||||
aliasing is disabled.
|
||||
.It "alias proxy cmd" Ar arg Ns No ...
|
||||
This command tells
|
||||
.Nm
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $Id: ppp.8,v 1.155 1999/03/07 11:54:42 brian Exp $
|
||||
.\" $Id: ppp.8,v 1.156 1999/03/07 15:02:38 brian Exp $
|
||||
.Dd 20 September 1995
|
||||
.nr XX \w'\fC00'
|
||||
.Os FreeBSD
|
||||
@ -2681,6 +2681,29 @@ or
|
||||
and only connections of the given protocol
|
||||
are matched. This option is useful if you wish to run things like
|
||||
Internet phone on the machines behind your gateway.
|
||||
.It "alias pptp" Op Ar addr
|
||||
This tells
|
||||
.Nm
|
||||
to alias any
|
||||
.Em G Ns No eneral
|
||||
.Em R Ns No outing
|
||||
.Em E Ns No encapsulated
|
||||
.Pq Dv IPPROTO_GRE
|
||||
packets using
|
||||
.Ar addr
|
||||
rather than the local interface address. This allows the uses of the
|
||||
.Em P Ns No oint
|
||||
to
|
||||
.Em P Ns No oint
|
||||
.Em T Ns No unneling
|
||||
.Em P Ns No rotocol
|
||||
on a machine on the internal network.
|
||||
.Pp
|
||||
If
|
||||
.Ar addr
|
||||
is not specified,
|
||||
.Dv PPTP
|
||||
aliasing is disabled.
|
||||
.It "alias proxy cmd" Ar arg Ns No ...
|
||||
This command tells
|
||||
.Nm
|
||||
|
Loading…
Reference in New Issue
Block a user