From 59e5f82dc7ba4c9aef20b39440ede48779bbe774 Mon Sep 17 00:00:00 2001 From: mtbishop Date: Sun, 7 Jul 2013 20:36:33 +0000 Subject: [PATCH] Buy in rfe3561826/bug32/pbz5668 code to add an %h macro to up/downs --- Makefile.in | 4 ++-- cfg_file.y | 3 ++- driver.h | 4 ++-- vtun.h | 3 ++- vtund.conf | 3 ++- vtund.conf.5 | 4 +++- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5e8287a..492c6d7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,7 +15,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# $Id: Makefile.in,v 1.11.2.6 2012/07/09 04:55:38 mtbishop Exp $ +# $Id: Makefile.in,v 1.11.2.7 2013/07/07 20:36:44 mtbishop Exp $ # CC = @CC@ CFLAGS = @CFLAGS@ @CPPFLAGS@ @@ -73,7 +73,7 @@ depend: makedepend -- $(CFLAGS) -- *.c clean: - rm -f core cfg_file.tab.* cfg_file.lex.* *.o *~ *.bak vtund + rm -f core cfg_file.tab.* cfg_file.lex.* *.o *~ .#* *.bak vtund distclean: clean rm -f $(CONFIGURE_FILES) diff --git a/cfg_file.y b/cfg_file.y index 307ac8d..a70fbf8 100644 --- a/cfg_file.y +++ b/cfg_file.y @@ -18,7 +18,7 @@ */ /* - * $Id: cfg_file.y,v 1.8.2.6 2012/07/09 01:01:08 mtbishop Exp $ + * $Id: cfg_file.y,v 1.8.2.7 2013/07/07 20:36:33 mtbishop Exp $ */ #include "config.h" @@ -107,6 +107,7 @@ statement: '\n' memcpy(parse_host, &default_host, sizeof(struct vtun_host)); parse_host->host = strdup($1); parse_host->passwd = NULL; + parse_host->sopt.host = strdup($1); /* Copy local address */ copy_addr(parse_host, &default_host); diff --git a/driver.h b/driver.h index ce2f5e9..c1d6aaa 100644 --- a/driver.h +++ b/driver.h @@ -17,14 +17,14 @@ */ /* - * $Id: driver.h,v 1.4.2.2 2008/01/07 22:35:30 mtbishop Exp $ + * $Id: driver.h,v 1.4.2.3 2013/07/07 20:36:37 mtbishop Exp $ */ #ifndef _DRIVER_H #define _DRIVER_H /* Definitions for device and protocol drivers * Interface will be completely rewritten in - * version 3.0 + * future versions. */ extern int (*dev_write)(int fd, char *buf, int len); diff --git a/vtun.h b/vtun.h index a3d6a9c..eacd0c5 100644 --- a/vtun.h +++ b/vtun.h @@ -17,7 +17,7 @@ */ /* - * $Id: vtun.h,v 1.12.2.7 2012/07/09 01:01:08 mtbishop Exp $ + * $Id: vtun.h,v 1.12.2.8 2013/07/07 20:36:56 mtbishop Exp $ */ #ifndef _VTUN_H @@ -51,6 +51,7 @@ struct vtun_sopt { int lport; char *raddr; int rport; + char *host; }; struct vtun_stat { diff --git a/vtund.conf b/vtund.conf index 31558f6..9a790be 100644 --- a/vtund.conf +++ b/vtund.conf @@ -6,7 +6,7 @@ # Ted Rolle # # Configuration file example -# $Id: vtund.conf,v 1.4.2.5 2012/07/07 07:14:17 mtbishop Exp $ +# $Id: vtund.conf,v 1.4.2.6 2013/07/07 20:36:48 mtbishop Exp $ # # # Lines which begin with '#' are comments @@ -227,6 +227,7 @@ # %P - Local TCP or UDP port # %a - Remote IP address # %p - Remote TCP or UDP port +# %h - Host Profile Name in config # # wait - Wait for the program termination. # diff --git a/vtund.conf.5 b/vtund.conf.5 index 9c1a729..149308a 100644 --- a/vtund.conf.5 +++ b/vtund.conf.5 @@ -1,5 +1,5 @@ .\" Manual page for vtund.conf -.\" $Id: vtund.conf.5,v 1.4.2.4 2012/07/07 07:14:17 mtbishop Exp $ +.\" $Id: vtund.conf.5,v 1.4.2.5 2013/07/07 20:36:52 mtbishop Exp $ .TH VTUND.CONF 5 .SH NAME @@ -315,6 +315,8 @@ Special characters that can be used inside \fIarguments\fR parameter: \fB%a\fR - Remote IP address .br \fB%p\fR - Remote TCP or UDP port +.br +\fB%h\fR - Host profile name .IP \fBppp\ \fIarguments\fR run program specified by \fBppp\fR statement in \fBoptions\fR section. All special character described above are valid in \fIarguments\fR here.