X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/72917fe7c663aced54f7e1185b7b72ba59aea73c..664a5c0e4b3ad8849af41c78977708c85a66c02f:/server/tun-slip.c?ds=sidebyside diff --git a/server/tun-slip.c b/server/tun-slip.c index 0df028e4..40830f9d 100644 --- a/server/tun-slip.c +++ b/server/tun-slip.c @@ -1,13 +1,11 @@ /* -*-c-*- * - * $Id$ - * * Tunnel packets via SLIP * * (c) 2005 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Trivial IP Encryption (TrIPE). * @@ -15,12 +13,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * TrIPE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with TrIPE; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -55,7 +53,7 @@ struct tunnel { # define ST_EOF 4u /* File descriptor reported EOF */ size_t n; /* Number of bytes used in buffer */ octet buf[PKBUFSZ]; /* Buffer for incoming data */ -}; +}; /*----- Static variables --------------------------------------------------*/ @@ -64,11 +62,6 @@ static const char *slipcmd; /* Script to make new interfaces */ /*----- Main code ---------------------------------------------------------*/ -#define SL_END 0xc0 -#define SL_ESC 0xdb -#define SL_ESCEND 0xdc -#define SL_ESCESC 0xdd - /* --- @t_read@ --- * * * Arguments: @int fd@ = file descriptor to read @@ -253,6 +246,7 @@ whine: /* --- @t_create@ --- * * * Arguments: @peer *p@ = pointer to peer block + * @int fd@ = file descriptor of tunnel device (unused) * @char **ifn@ = where to put the interface name * * Returns: A tunnel block if it worked, or null on failure. @@ -260,7 +254,7 @@ whine: * Use: Initializes a new tunnel. */ -static tunnel *t_create(peer *p, char **ifn) +static tunnel *t_create(peer *p, int fd, char **ifn) { slipif *sl = 0; int pin[2] = { -1, -1 }, pout[2] = { -1, -1 }; @@ -446,6 +440,7 @@ static void t_destroy(tunnel *t) const tunnel_ops tun_slip = { "slip", + 0, t_init, t_create, t_setifname,