1 /* 2 * tcpproxy 3 * 4 * tcpproxy is a simple tcp connection proxy which combines the 5 * features of rinetd and 6tunnel. tcpproxy supports IPv4 and 6 * IPv6 and also supports connections from IPv6 to IPv4 7 * endpoints and vice versa. 8 * 9 * 10 * Copyright (C) 2010-2015 Christian Pointner <equinox@spreadspace.org> 11 * 12 * This file is part of tcpproxy. 13 * 14 * tcpproxy is free software: you can redistribute it and/or modify 15 * it under the terms of the GNU General Public License as published by 16 * the Free Software Foundation, either version 3 of the License, or 17 * any later version. 18 * 19 * tcpproxy is distributed in the hope that it will be useful, 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * GNU General Public License for more details. 23 * 24 * You should have received a copy of the GNU General Public License 25 * along with tcpproxy. If not, see <http://www.gnu.org/licenses/>. 26 */ 27 28 #ifndef TCPPROXY_slist_h_INCLUDED 29 #define TCPPROXY_slist_h_INCLUDED 30 31 struct slist_element_struct { 32 void* data_; 33 struct slist_element_struct* next_; 34 }; 35 typedef struct slist_element_struct slist_element_t; 36 37 slist_element_t* slist_get_last(slist_element_t* first); 38 39 struct slist_struct { 40 void (*delete_element)(void* element); 41 slist_element_t* first_; 42 }; 43 typedef struct slist_struct slist_t; 44 45 int slist_init(slist_t* lst, void (*delete_element)(void*)); 46 slist_element_t* slist_add(slist_t* lst, void* data); 47 void slist_remove(slist_t* lst, void* data); 48 void slist_clear(slist_t* lst); 49 int slist_length(slist_t* lst); 50 51 #endif 52