Markus Armbruster | 121d071 | 2016-06-29 10:12:57 +0200 | [diff] [blame] | 1 | #ifndef SLIRP_H |
| 2 | #define SLIRP_H |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 3 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 4 | #include "slirp_config.h" |
| 5 | |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 6 | #ifdef _WIN32 |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 7 | |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 8 | typedef char *caddr_t; |
| 9 | |
bellard | 3444413 | 2005-01-10 23:19:34 +0000 | [diff] [blame] | 10 | # include <windows.h> |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 11 | # include <winsock2.h> |
balrog | 116842e | 2008-05-17 18:07:00 +0000 | [diff] [blame] | 12 | # include <ws2tcpip.h> |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 13 | # include <sys/timeb.h> |
| 14 | # include <iphlpapi.h> |
| 15 | |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 16 | #else |
Andreas Färber | 4a2b39d | 2010-09-20 00:50:48 +0200 | [diff] [blame] | 17 | # if !defined(__HAIKU__) |
| 18 | # define O_BINARY 0 |
| 19 | # endif |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 20 | #endif |
| 21 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 22 | #ifdef HAVE_SYS_BITYPES_H |
| 23 | # include <sys/bitypes.h> |
| 24 | #endif |
| 25 | |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 26 | #ifndef _WIN32 |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 27 | #include <sys/uio.h> |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 28 | #endif |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 29 | |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 30 | #ifndef _WIN32 |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 31 | #include <netinet/in.h> |
| 32 | #include <arpa/inet.h> |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 33 | #endif |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 34 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 35 | #ifndef NO_UNIX_SOCKETS |
| 36 | #include <sys/un.h> |
| 37 | #endif |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 38 | #ifdef HAVE_SYS_SIGNAL_H |
| 39 | # include <sys/signal.h> |
| 40 | #endif |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 41 | #ifndef _WIN32 |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 42 | #include <sys/socket.h> |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 43 | #endif |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 44 | |
bellard | ee2654a | 2004-07-12 21:11:45 +0000 | [diff] [blame] | 45 | #if defined(HAVE_SYS_IOCTL_H) |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 46 | # include <sys/ioctl.h> |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 47 | #endif |
| 48 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 49 | #ifdef HAVE_SYS_SELECT_H |
| 50 | # include <sys/select.h> |
| 51 | #endif |
| 52 | |
| 53 | #ifdef HAVE_SYS_WAIT_H |
| 54 | # include <sys/wait.h> |
| 55 | #endif |
| 56 | |
| 57 | #ifdef HAVE_SYS_FILIO_H |
| 58 | # include <sys/filio.h> |
| 59 | #endif |
| 60 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 61 | /* Avoid conflicting with the libc insque() and remque(), which |
| 62 | have different prototypes. */ |
| 63 | #define insque slirp_insque |
| 64 | #define remque slirp_remque |
Samuel Thibault | 67e3eee | 2016-02-22 22:29:21 +0100 | [diff] [blame] | 65 | #define quehead slirp_quehead |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 66 | |
| 67 | #ifdef HAVE_SYS_STROPTS_H |
| 68 | #include <sys/stropts.h> |
| 69 | #endif |
| 70 | |
Guillaume Subiron | 0d6ff71 | 2016-03-15 10:31:19 +0100 | [diff] [blame] | 71 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 72 | #include "debug.h" |
| 73 | |
Paolo Bonzini | 1de7afc | 2012-12-17 18:20:00 +0100 | [diff] [blame] | 74 | #include "qemu/queue.h" |
| 75 | #include "qemu/sockets.h" |
Dr. David Alan Gilbert | 9c7ffe2 | 2016-01-08 14:41:28 +0000 | [diff] [blame] | 76 | #include "net/eth.h" |
Jan Kiszka | b1c99fc | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 77 | |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 78 | #include "libslirp.h" |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 79 | #include "ip.h" |
Guillaume Subiron | 0d6ff71 | 2016-03-15 10:31:19 +0100 | [diff] [blame] | 80 | #include "ip6.h" |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 81 | #include "tcp.h" |
| 82 | #include "tcp_timer.h" |
| 83 | #include "tcp_var.h" |
| 84 | #include "tcpip.h" |
| 85 | #include "udp.h" |
Jan Kiszka | e6d43cf | 2011-07-20 12:20:18 +0200 | [diff] [blame] | 86 | #include "ip_icmp.h" |
Guillaume Subiron | 0d6ff71 | 2016-03-15 10:31:19 +0100 | [diff] [blame] | 87 | #include "ip6_icmp.h" |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 88 | #include "mbuf.h" |
| 89 | #include "sbuf.h" |
| 90 | #include "socket.h" |
| 91 | #include "if.h" |
| 92 | #include "main.h" |
| 93 | #include "misc.h" |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 94 | |
| 95 | #include "bootp.h" |
bellard | c7f7464 | 2004-08-24 21:57:12 +0000 | [diff] [blame] | 96 | #include "tftp.h" |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 97 | |
Fabien Chouteau | 1a0ca1e | 2011-08-03 12:52:54 +0200 | [diff] [blame] | 98 | #define ARPOP_REQUEST 1 /* ARP request */ |
| 99 | #define ARPOP_REPLY 2 /* ARP reply */ |
| 100 | |
| 101 | struct ethhdr { |
| 102 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ |
| 103 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ |
| 104 | unsigned short h_proto; /* packet type ID field */ |
| 105 | }; |
| 106 | |
Thomas Huth | 1f8b56e | 2016-08-15 10:24:54 +0200 | [diff] [blame] | 107 | struct slirp_arphdr { |
Fabien Chouteau | 1a0ca1e | 2011-08-03 12:52:54 +0200 | [diff] [blame] | 108 | unsigned short ar_hrd; /* format of hardware address */ |
| 109 | unsigned short ar_pro; /* format of protocol address */ |
| 110 | unsigned char ar_hln; /* length of hardware address */ |
| 111 | unsigned char ar_pln; /* length of protocol address */ |
| 112 | unsigned short ar_op; /* ARP opcode (command) */ |
| 113 | |
| 114 | /* |
| 115 | * Ethernet looks like this : This bit is variable sized however... |
| 116 | */ |
| 117 | unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */ |
| 118 | uint32_t ar_sip; /* sender IP address */ |
| 119 | unsigned char ar_tha[ETH_ALEN]; /* target hardware address */ |
| 120 | uint32_t ar_tip; /* target IP address */ |
Stefan Weil | 541dc0d | 2011-08-31 12:38:01 +0200 | [diff] [blame] | 121 | } QEMU_PACKED; |
Fabien Chouteau | 1a0ca1e | 2011-08-03 12:52:54 +0200 | [diff] [blame] | 122 | |
| 123 | #define ARP_TABLE_SIZE 16 |
| 124 | |
| 125 | typedef struct ArpTable { |
Thomas Huth | 1f8b56e | 2016-08-15 10:24:54 +0200 | [diff] [blame] | 126 | struct slirp_arphdr table[ARP_TABLE_SIZE]; |
Fabien Chouteau | 1a0ca1e | 2011-08-03 12:52:54 +0200 | [diff] [blame] | 127 | int next_victim; |
| 128 | } ArpTable; |
| 129 | |
Jan Kiszka | 5a371a2 | 2011-08-05 12:51:11 +0200 | [diff] [blame] | 130 | void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN]); |
Fabien Chouteau | 1a0ca1e | 2011-08-03 12:52:54 +0200 | [diff] [blame] | 131 | |
Jan Kiszka | 5a371a2 | 2011-08-05 12:51:11 +0200 | [diff] [blame] | 132 | bool arp_table_search(Slirp *slirp, uint32_t ip_addr, |
Fabien Chouteau | 1a0ca1e | 2011-08-03 12:52:54 +0200 | [diff] [blame] | 133 | uint8_t out_ethaddr[ETH_ALEN]); |
Kevin Wolf | 40ff6d7 | 2009-12-02 12:24:42 +0100 | [diff] [blame] | 134 | |
Guillaume Subiron | 0d6ff71 | 2016-03-15 10:31:19 +0100 | [diff] [blame] | 135 | struct ndpentry { |
| 136 | unsigned char eth_addr[ETH_ALEN]; /* sender hardware address */ |
| 137 | struct in6_addr ip_addr; /* sender IP address */ |
| 138 | } QEMU_PACKED; |
| 139 | |
| 140 | #define NDP_TABLE_SIZE 16 |
| 141 | |
| 142 | typedef struct NdpTable { |
| 143 | struct ndpentry table[NDP_TABLE_SIZE]; |
| 144 | int next_victim; |
| 145 | } NdpTable; |
| 146 | |
| 147 | void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr, |
| 148 | uint8_t ethaddr[ETH_ALEN]); |
| 149 | bool ndp_table_search(Slirp *slirp, struct in6_addr ip_addr, |
| 150 | uint8_t out_ethaddr[ETH_ALEN]); |
| 151 | |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 152 | struct Slirp { |
Blue Swirl | 72cf2d4 | 2009-09-12 07:36:22 +0000 | [diff] [blame] | 153 | QTAILQ_ENTRY(Slirp) entry; |
Liu Ping Fan | fe0ff43 | 2013-08-25 10:01:19 +0800 | [diff] [blame] | 154 | u_int time_fasttimo; |
| 155 | u_int last_slowtimo; |
| 156 | bool do_slowtimo; |
Jan Kiszka | b1c99fc | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 157 | |
Samuel Thibault | 0b11c03 | 2016-03-20 12:29:54 +0100 | [diff] [blame] | 158 | bool in_enabled, in6_enabled; |
| 159 | |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 160 | /* virtual network configuration */ |
| 161 | struct in_addr vnetwork_addr; |
| 162 | struct in_addr vnetwork_mask; |
| 163 | struct in_addr vhost_addr; |
Guillaume Subiron | 0d6ff71 | 2016-03-15 10:31:19 +0100 | [diff] [blame] | 164 | struct in6_addr vprefix_addr6; |
| 165 | uint8_t vprefix_len; |
| 166 | struct in6_addr vhost_addr6; |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 167 | struct in_addr vdhcp_startaddr; |
| 168 | struct in_addr vnameserver_addr; |
Guillaume Subiron | 05061d8 | 2016-03-15 10:31:22 +0100 | [diff] [blame] | 169 | struct in6_addr vnameserver_addr6; |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 170 | |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 171 | struct in_addr client_ipaddr; |
| 172 | char client_hostname[33]; |
| 173 | |
| 174 | int restricted; |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 175 | struct ex_list *exec_list; |
| 176 | |
| 177 | /* mbuf states */ |
Samuel Thibault | 67e3eee | 2016-02-22 22:29:21 +0100 | [diff] [blame] | 178 | struct quehead m_freelist; |
| 179 | struct quehead m_usedlist; |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 180 | int mbuf_alloced; |
| 181 | |
| 182 | /* if states */ |
Samuel Thibault | 67e3eee | 2016-02-22 22:29:21 +0100 | [diff] [blame] | 183 | struct quehead if_fastq; /* fast queue (for interactive data) */ |
| 184 | struct quehead if_batchq; /* queue for non-interactive data */ |
Jan Kiszka | 953e7f5 | 2012-03-05 19:50:39 +0100 | [diff] [blame] | 185 | bool if_start_busy; /* avoid if_start recursion */ |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 186 | |
| 187 | /* ip states */ |
| 188 | struct ipq ipq; /* ip reass. queue */ |
Stefan Weil | b6dce92 | 2010-07-22 22:15:23 +0200 | [diff] [blame] | 189 | uint16_t ip_id; /* ip packet ctr, for ids */ |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 190 | |
| 191 | /* bootp/dhcp states */ |
| 192 | BOOTPClient bootp_clients[NB_BOOTP_CLIENTS]; |
| 193 | char *bootp_filename; |
Klaus Stengel | 63d2960 | 2012-10-27 19:53:39 +0200 | [diff] [blame] | 194 | size_t vdnssearch_len; |
| 195 | uint8_t *vdnssearch; |
Benjamin Drung | f18d137 | 2018-02-27 17:06:01 +0100 | [diff] [blame] | 196 | char *vdomainname; |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 197 | |
| 198 | /* tcp states */ |
| 199 | struct socket tcb; |
| 200 | struct socket *tcp_last_so; |
| 201 | tcp_seq tcp_iss; /* tcp initial send seq # */ |
Stefan Weil | b6dce92 | 2010-07-22 22:15:23 +0200 | [diff] [blame] | 202 | uint32_t tcp_now; /* for RFC 1323 timestamps */ |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 203 | |
| 204 | /* udp states */ |
| 205 | struct socket udb; |
| 206 | struct socket *udp_last_so; |
| 207 | |
Jan Kiszka | e6d43cf | 2011-07-20 12:20:18 +0200 | [diff] [blame] | 208 | /* icmp states */ |
| 209 | struct socket icmp; |
| 210 | struct socket *icmp_last_so; |
| 211 | |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 212 | /* tftp states */ |
| 213 | char *tftp_prefix; |
| 214 | struct tftp_session tftp_sessions[TFTP_SESSIONS_MAX]; |
Fam Zheng | 0fca92b | 2018-09-14 15:26:16 +0800 | [diff] [blame] | 215 | char *tftp_server_name; |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 216 | |
Fabien Chouteau | 1a0ca1e | 2011-08-03 12:52:54 +0200 | [diff] [blame] | 217 | ArpTable arp_table; |
Guillaume Subiron | 0d6ff71 | 2016-03-15 10:31:19 +0100 | [diff] [blame] | 218 | NdpTable ndp_table; |
| 219 | |
| 220 | GRand *grand; |
| 221 | QEMUTimer *ra_timer; |
Fabien Chouteau | 1a0ca1e | 2011-08-03 12:52:54 +0200 | [diff] [blame] | 222 | |
Jan Kiszka | 9f8bd04 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 223 | void *opaque; |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 224 | }; |
| 225 | |
Jan Kiszka | ad0d8c4 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 226 | extern Slirp *slirp_instance; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 227 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 228 | #ifndef NULL |
| 229 | #define NULL (void *)0 |
| 230 | #endif |
| 231 | |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 232 | void if_start(Slirp *); |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 233 | |
Cédric Le Goater | 47bb83c | 2017-04-14 10:35:03 +0200 | [diff] [blame] | 234 | /* ncsi.c */ |
| 235 | void ncsi_input(Slirp *slirp, const uint8_t *pkt, int pkt_len); |
| 236 | |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 237 | #ifndef _WIN32 |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 238 | #include <netdb.h> |
bellard | 379ff53 | 2004-07-12 22:33:07 +0000 | [diff] [blame] | 239 | #endif |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 240 | |
blueswir1 | 9634d90 | 2007-10-26 19:01:16 +0000 | [diff] [blame] | 241 | #define SO_OPTIONS DO_KEEPALIVE |
| 242 | #define TCP_MAXIDLE (TCPTV_KEEPCNT * TCPTV_KEEPINTVL) |
| 243 | |
Klaus Stengel | 63d2960 | 2012-10-27 19:53:39 +0200 | [diff] [blame] | 244 | /* dnssearch.c */ |
| 245 | int translate_dnssearch(Slirp *s, const char ** names); |
| 246 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 247 | /* cksum.c */ |
| 248 | int cksum(struct mbuf *m, int len); |
Guillaume Subiron | 0d6ff71 | 2016-03-15 10:31:19 +0100 | [diff] [blame] | 249 | int ip6_cksum(struct mbuf *m); |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 250 | |
| 251 | /* if.c */ |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 252 | void if_init(Slirp *); |
| 253 | void if_output(struct socket *, struct mbuf *); |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 254 | |
| 255 | /* ip_input.c */ |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 256 | void ip_init(Slirp *); |
Jan Kiszka | a68adc2 | 2012-02-29 19:14:23 +0100 | [diff] [blame] | 257 | void ip_cleanup(Slirp *); |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 258 | void ip_input(struct mbuf *); |
| 259 | void ip_slowtimo(Slirp *); |
| 260 | void ip_stripoptions(register struct mbuf *, struct mbuf *); |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 261 | |
| 262 | /* ip_output.c */ |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 263 | int ip_output(struct socket *, struct mbuf *); |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 264 | |
Guillaume Subiron | 0d6ff71 | 2016-03-15 10:31:19 +0100 | [diff] [blame] | 265 | /* ip6_input.c */ |
| 266 | void ip6_init(Slirp *); |
| 267 | void ip6_cleanup(Slirp *); |
| 268 | void ip6_input(struct mbuf *); |
| 269 | |
| 270 | /* ip6_output */ |
| 271 | int ip6_output(struct socket *, struct mbuf *, int fast); |
| 272 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 273 | /* tcp_input.c */ |
Guillaume Subiron | 9dfbf25 | 2016-03-15 10:31:21 +0100 | [diff] [blame] | 274 | void tcp_input(register struct mbuf *, int, struct socket *, unsigned short af); |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 275 | int tcp_mss(register struct tcpcb *, u_int); |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 276 | |
| 277 | /* tcp_output.c */ |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 278 | int tcp_output(register struct tcpcb *); |
| 279 | void tcp_setpersist(register struct tcpcb *); |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 280 | |
| 281 | /* tcp_subr.c */ |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 282 | void tcp_init(Slirp *); |
Jan Kiszka | a68adc2 | 2012-02-29 19:14:23 +0100 | [diff] [blame] | 283 | void tcp_cleanup(Slirp *); |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 284 | void tcp_template(struct tcpcb *); |
Guillaume Subiron | 9dfbf25 | 2016-03-15 10:31:21 +0100 | [diff] [blame] | 285 | void tcp_respond(struct tcpcb *, register struct tcpiphdr *, |
| 286 | register struct mbuf *, tcp_seq, tcp_seq, int, unsigned short); |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 287 | struct tcpcb * tcp_newtcpcb(struct socket *); |
| 288 | struct tcpcb * tcp_close(register struct tcpcb *); |
| 289 | void tcp_sockclosed(struct tcpcb *); |
Guillaume Subiron | cc573a6 | 2015-12-19 22:25:03 +0100 | [diff] [blame] | 290 | int tcp_fconnect(struct socket *, unsigned short af); |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 291 | void tcp_connect(struct socket *); |
| 292 | int tcp_attach(struct socket *); |
Stefan Weil | b6dce92 | 2010-07-22 22:15:23 +0200 | [diff] [blame] | 293 | uint8_t tcp_tos(struct socket *); |
Blue Swirl | 6cb9c6d | 2009-07-01 19:11:17 +0000 | [diff] [blame] | 294 | int tcp_emu(struct socket *, struct mbuf *); |
| 295 | int tcp_ctl(struct socket *); |
bellard | 9fafc9e | 2004-04-26 19:50:09 +0000 | [diff] [blame] | 296 | struct tcpcb *tcp_drop(struct tcpcb *tp, int err); |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 297 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 298 | #endif |