diff --git a/dnstun.c b/dnstun.c index f58f01c..ffbc370 100644 --- a/dnstun.c +++ b/dnstun.c @@ -1,5 +1,7 @@ /* - * Copyright (c) 2006 Bjorn Andersson + * Copyright (c) 2006 + * Bjorn Andersson , + * Erik Ekman * * 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 +#include #include "tun.h" @@ -23,8 +26,6 @@ main() { open_tun(); - sleep(10); - close_tun(); return 0; diff --git a/tun.c b/tun.c index 8daa42c..97fd53a 100644 --- a/tun.c +++ b/tun.c @@ -1,5 +1,7 @@ /* - * Copyright (c) 2006 Bjorn Andersson + * Copyright (c) 2006 + * Bjorn Andersson , + * Erik Ekman * * 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 #include #include +#include #include #include #include @@ -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); } diff --git a/tun.h b/tun.h index baceeca..3cd3420 100644 --- a/tun.h +++ b/tun.h @@ -1,5 +1,7 @@ /* - * Copyright (c) 2006 Bjorn Andersson + * Copyright (c) 2006 + * Bjorn Andersson , + * Erik Ekman * * 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_ */