From 10f681b1faa30ad9293a4fb87e6920142318f429 Mon Sep 17 00:00:00 2001 Message-Id: <10f681b1faa30ad9293a4fb87e6920142318f429.1715113700.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 8 Dec 2008 12:10:40 +0000 Subject: [PATCH] server, common: New header slip.h contains definitions for SLIP. Organization: Straylight/Edgeware From: Mark Wooding This will be needed by another program as well. --- common/slip.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++ server/tripe.h | 1 + server/tun-slip.c | 5 ----- 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 common/slip.h diff --git a/common/slip.h b/common/slip.h new file mode 100644 index 00000000..aeead1e0 --- /dev/null +++ b/common/slip.h @@ -0,0 +1,49 @@ +/* -*-c-*- + * + * Definitions for SLIP + * + * (c) 2008 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of Trivial IP Encryption (TrIPE). + * + * TrIPE is free software; you can redistribute it and/or modify + * 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. + */ + +#ifndef SLIP_H +#define SLIP_H + +#ifdef __cplusplus + extern "C" { +#endif + +/*----- Magic constants ---------------------------------------------------*/ + +/* --- SLIP protocol --- */ + +#define SL_END 0xc0 /* End-of-packet boundary */ +#define SL_ESC 0xdb /* Next character is magic */ +#define SL_ESCEND 0xdc /* Really meant @SL_END@ */ +#define SL_ESCESC 0xdd /* Really meant @SL_ESC@ */ + +/*----- That's all, folks -------------------------------------------------*/ + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/server/tripe.h b/server/tripe.h index 43d2bdf9..6cfffc52 100644 --- a/server/tripe.h +++ b/server/tripe.h @@ -104,6 +104,7 @@ #include #include "protocol.h" +#include "slip.h" #include "util.h" #undef sun diff --git a/server/tun-slip.c b/server/tun-slip.c index 2c99a81a..d405cc49 100644 --- a/server/tun-slip.c +++ b/server/tun-slip.c @@ -62,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 -- [mdw]