Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / net / tcp.h
blob5a9305ab88d10c5556244e69d224b049865fc703
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2010,2011 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_NET_TCP_HEADER
20 #define GRUB_NET_TCP_HEADER 1
21 #include <grub/types.h>
22 #include <grub/net.h>
24 struct grub_net_tcp_socket;
25 typedef struct grub_net_tcp_socket *grub_net_tcp_socket_t;
27 struct grub_net_tcp_listen;
28 typedef struct grub_net_tcp_listen *grub_net_tcp_listen_t;
30 grub_net_tcp_socket_t
31 grub_net_tcp_open (char *server,
32 grub_uint16_t out_port,
33 grub_err_t (*recv_hook) (grub_net_tcp_socket_t sock,
34 struct grub_net_buff *nb,
35 void *data),
36 void (*error_hook) (grub_net_tcp_socket_t sock,
37 void *data),
38 void (*fin_hook) (grub_net_tcp_socket_t sock,
39 void *data),
40 void *hook_data);
42 grub_net_tcp_listen_t
43 grub_net_tcp_listen (grub_uint16_t port,
44 const struct grub_net_network_level_interface *inf,
45 grub_err_t (*listen_hook) (grub_net_tcp_listen_t listen,
46 grub_net_tcp_socket_t sock,
47 void *data),
48 void *hook_data);
50 void
51 grub_net_tcp_stop_listen (grub_net_tcp_listen_t listen);
53 grub_err_t
54 grub_net_send_tcp_packet (const grub_net_tcp_socket_t socket,
55 struct grub_net_buff *nb,
56 int push);
58 enum
60 GRUB_NET_TCP_CONTINUE_RECEIVING,
61 GRUB_NET_TCP_DISCARD,
62 GRUB_NET_TCP_ABORT
65 void
66 grub_net_tcp_close (grub_net_tcp_socket_t sock, int discard_received);
68 grub_err_t
69 grub_net_tcp_accept (grub_net_tcp_socket_t sock,
70 grub_err_t (*recv_hook) (grub_net_tcp_socket_t sock,
71 struct grub_net_buff *nb,
72 void *data),
73 void (*error_hook) (grub_net_tcp_socket_t sock,
74 void *data),
75 void (*fin_hook) (grub_net_tcp_socket_t sock,
76 void *data),
77 void *hook_data);
79 void
80 grub_net_tcp_stall (grub_net_tcp_socket_t sock);
82 void
83 grub_net_tcp_unstall (grub_net_tcp_socket_t sock);
85 #endif