00001 /* 00002 * tun.h 00003 * 00004 * Network tunnel device. 00005 * 00006 * Copyright (c) 2001 Dug Song <dugsong@monkey.org> 00007 * 00008 * $Id: tun.h,v 1.2 2005/01/25 21:29:12 dugsong Exp $ 00009 */ 00010 00011 #ifndef DNET_TUN_H 00012 #define DNET_TUN_H 00013 00014 typedef struct tun tun_t; 00015 00016 __BEGIN_DECLS 00017 tun_t *tun_open(struct addr *src, struct addr *dst, int mtu); 00018 int tun_fileno(tun_t *tun); 00019 const char *tun_name(tun_t *tun); 00020 ssize_t tun_send(tun_t *tun, const void *buf, size_t size); 00021 ssize_t tun_recv(tun_t *tun, void *buf, size_t size); 00022 tun_t *tun_close(tun_t *tun); 00023 __END_DECLS 00024 00025 #endif /* DNET_TUN_H */