Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / net / udp.h
blob1a7efa7773fc022fb2643ed3919cb795630a8b76
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_UDP_HEADER
20 #define GRUB_NET_UDP_HEADER 1
21 #include <grub/types.h>
22 #include <grub/net.h>
24 struct udphdr
26 grub_uint16_t src;
27 grub_uint16_t dst;
28 grub_uint16_t len;
29 grub_uint16_t chksum;
30 } __attribute__ ((packed));
32 struct grub_net_udp_socket;
33 typedef struct grub_net_udp_socket *grub_net_udp_socket_t;
35 grub_net_udp_socket_t
36 grub_net_udp_open (grub_net_network_level_address_t addr,
37 grub_uint16_t out_port,
38 grub_err_t (*recv_hook) (grub_net_udp_socket_t sock,
39 struct grub_net_buff *nb,
40 void *data),
41 void *recv_hook_data);
43 void
44 grub_net_udp_close (grub_net_udp_socket_t sock);
46 grub_err_t
47 grub_net_send_udp_packet (const grub_net_udp_socket_t socket,
48 struct grub_net_buff *nb);
51 #endif