/*
- * Encrypting tunnel for userv-ipif tunnels, actual implementation
+ * Encrypting tunnel for userv-ipif tunnels, actual core implementation
*/
/*
* usage:
* writer to reader first, then keys for packets from reader to
* writer.
*
- * Every must be numeric. There is very little argument checking.
+ * Every addr or port must be numeric. There is very little argument checking.
*
* Exit status:
* SIGALARM timed out
* 16 bad trouble
*/
/*
- * Copyright (C) 2000 Ian Jackson
+ * This file is part of ipif, part of userv-utils
+ *
+ * Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ * Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk>
+ * Copyright 1999,2003
+ * Chancellor Masters and Scholars of the University of Cambridge
+ * Copyright 2010 Tony Finch <fanf@dotat.at>
*
* This 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
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with userv-utils; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with userv-utils; if not, see http://www.gnu.org/licenses/.
*/
#include <sys/socket.h>
static const struct mechanism *mechs[MAXMECHS];
static struct mechdata *md_in[MAXMECHS], *md_out[MAXMECHS];
-static size_t maxprefix, maxsuffix;
+static int maxprefix, maxsuffix;
static struct buffer buf_in, buf_out;
static unsigned char *accum_buf;
static unsigned long npackets, nbytes;
struct sockaddr_in this_saddr;
- int r, i, different, this_saddrlen;
+ size_t this_saddrlen;
+ int r, i, different;
const char *emsg;
buf_in.start= buf_in.base+1;
if (keepalive) {
tnow= now();
- if (tnow >= nextsendka && public_remote_specd) sendpacket("\300",1);
+ if (tnow >= nextsendka && public_remote_specd)
+ sendpacket((unsigned char*)"\300",1);
polltimeout= (nextsendka - tnow)*1000;
} else {
polltimeout= -1;