1 /*
2  *  Hans - IP over ICMP
3  *  Copyright (C) 2013 Friedrich Schöller <hans@schoeller.se>
4  *                1998-2000 Maxim Krasnyansky <max_mk@yahoo.com>
5  *
6  *  This program is free software: you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation, either version 3 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifdef WIN32
22 
23 #include <stdint.h>
24 #include <stdbool.h>
25 
26 #define VTUN_DEV_LEN 100
27 
28 #else
29 
30 #define VTUN_DEV_LEN 20
31 
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38     int tun_open(char *dev);
39     int tun_close(int fd, char *dev);
40     int tun_write(int fd, char *buf, int len);
41     int tun_read(int fd, char *buf, int len);
42     const char *tun_last_error();
43 
44 #ifdef WIN32
45     bool tun_set_ip(int fd, uint32_t local, uint32_t network, uint32_t netmask);
46 #endif
47 
48 #ifdef __cplusplus
49 }
50 #endif
51