chiark
/
gitweb
/
~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
peer, tunnels: New file-descriptor opening interface.
[tripe]
/
server
/
tun-slip.c
diff --git
a/server/tun-slip.c
b/server/tun-slip.c
index 785d008f6c31ef15e2a8727ed8af1d3e88f9c590..4afef753d9ef43fc388fd2e9cd1903fbde566f25 100644
(file)
--- a/
server/tun-slip.c
+++ b/
server/tun-slip.c
@@
-1,6
+1,4
@@
/* -*-c-*-
/* -*-c-*-
- *
- * $Id$
*
* Tunnel packets via SLIP
*
*
* Tunnel packets via SLIP
*
@@
-64,11
+62,6
@@
static const char *slipcmd; /* Script to make new interfaces */
/*----- Main code ---------------------------------------------------------*/
/*----- 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
/* --- @t_read@ --- *
*
* Arguments: @int fd@ = file descriptor to read
@@
-253,6
+246,7
@@
whine:
/* --- @t_create@ --- *
*
* Arguments: @peer *p@ = pointer to peer block
/* --- @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.
* @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.
*/
* 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 };
{
slipif *sl = 0;
int pin[2] = { -1, -1 }, pout[2] = { -1, -1 };
@@
-447,6
+441,7
@@
static void t_destroy(tunnel *t)
const tunnel_ops tun_slip = {
"slip",
t_init,
const tunnel_ops tun_slip = {
"slip",
t_init,
+ 0,
t_create,
t_setifname,
t_inject,
t_create,
t_setifname,
t_inject,