Make it compile on linux, added copyright
This commit is contained in:
parent
c5e6cfa708
commit
151a9134fa
7
dnstun.c
7
dnstun.c
|
@ -1,5 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Bjorn Andersson <flex@kryo.se>
|
||||
* Copyright (c) 2006
|
||||
* Bjorn Andersson <flex@kryo.se>,
|
||||
* Erik Ekman <yarrick@kryo.se>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -15,6 +17,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "tun.h"
|
||||
|
||||
|
@ -23,8 +26,6 @@ main()
|
|||
{
|
||||
open_tun();
|
||||
|
||||
sleep(10);
|
||||
|
||||
close_tun();
|
||||
|
||||
return 0;
|
||||
|
|
9
tun.c
9
tun.c
|
@ -1,5 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Bjorn Andersson <flex@kryo.se>
|
||||
* Copyright (c) 2006
|
||||
* Bjorn Andersson <flex@kryo.se>,
|
||||
* Erik Ekman <yarrick@kryo.se>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -18,6 +20,7 @@
|
|||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -107,7 +110,7 @@ close_tun()
|
|||
}
|
||||
|
||||
int
|
||||
write_tun(u_char *buf, int len)
|
||||
write_tun(uint8_t *buf, int len)
|
||||
{
|
||||
if (write(tun_fd, buf, len) != len)
|
||||
err(1, "write_tun: %s", strerror(errno));
|
||||
|
@ -116,7 +119,7 @@ write_tun(u_char *buf, int len)
|
|||
}
|
||||
|
||||
int
|
||||
read_tun(u_char *buf, int len)
|
||||
read_tun(uint8_t *buf, int len)
|
||||
{
|
||||
return read(tun_fd, buf, len);
|
||||
}
|
||||
|
|
12
tun.h
12
tun.h
|
@ -1,5 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Bjorn Andersson <flex@kryo.se>
|
||||
* Copyright (c) 2006
|
||||
* Bjorn Andersson <flex@kryo.se>,
|
||||
* Erik Ekman <yarrick@kryo.se>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -20,9 +22,9 @@
|
|||
extern char *tun_device;
|
||||
extern int tun_fd;
|
||||
|
||||
extern int open_tun();
|
||||
extern void close_tun();
|
||||
extern int write_tun(u_char *buf, int len);
|
||||
extern int read_tun(u_char *buf, int len);
|
||||
int open_tun();
|
||||
void close_tun();
|
||||
int write_tun(uint8_t *buf, int len);
|
||||
int read_tun(uint8_t *buf, int len);
|
||||
|
||||
#endif /* _TUN_H_ */
|
||||
|
|
Loading…
Reference in New Issue