1 /* 2 VTun - Virtual Tunnel over TCP/IP network. 3 4 Copyright (C) 1998-2016 Maxim Krasnyansky <max_mk@yahoo.com> 5 6 VTun has been derived from VPPP package by Maxim Krasnyansky. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 */ 18 19 /* 20 * $Id: driver.h,v 1.4.2.4 2016/10/01 21:27:51 mtbishop Exp $ 21 */ 22 #ifndef _DRIVER_H 23 #define _DRIVER_H 24 25 /* Definitions for device and protocol drivers 26 * Interface will be completely rewritten in 27 * future versions. 28 */ 29 30 extern int (*dev_write)(int fd, char *buf, int len); 31 extern int (*dev_read)(int fd, char *buf, int len); 32 33 extern int (*proto_write)(int fd, char *buf, int len); 34 extern int (*proto_read)(int fd, char *buf); 35 36 int tun_open(char *dev); 37 int tun_close(int fd, char *dev); 38 int tun_write(int fd, char *buf, int len); 39 int tun_read(int fd, char *buf, int len); 40 41 int tap_open(char *dev); 42 int tap_close(int fd, char *dev); 43 int tap_write(int fd, char *buf, int len); 44 int tap_read(int fd, char *buf, int len); 45 46 int pty_open(char *dev); 47 int pty_write(int fd, char *buf, int len); 48 int pty_read(int fd, char *buf, int len); 49 50 int pipe_open(int *fd); 51 int pipe_write(int fd, char *buf, int len); 52 int pipe_read(int fd, char *buf, int len); 53 54 int tcp_write(int fd, char *buf, int len); 55 int tcp_read(int fd, char *buf); 56 57 int udp_write(int fd, char *buf, int len); 58 int udp_read(int fd, char *buf); 59 60 #endif 61