vaseboot/include/VasEBoot/net/udp.h

52 lines
1.6 KiB
C

/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2010,2011 Free Software Foundation, Inc.
*
* VAS_EBOOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VAS_EBOOT_NET_UDP_HEADER
#define VAS_EBOOT_NET_UDP_HEADER 1
#include <VasEBoot/types.h>
#include <VasEBoot/net.h>
struct udphdr
{
VasEBoot_uint16_t src;
VasEBoot_uint16_t dst;
VasEBoot_uint16_t len;
VasEBoot_uint16_t chksum;
} VAS_EBOOT_PACKED;
struct VasEBoot_net_udp_socket;
typedef struct VasEBoot_net_udp_socket *VasEBoot_net_udp_socket_t;
VasEBoot_net_udp_socket_t
VasEBoot_net_udp_open (VasEBoot_net_network_level_address_t addr,
VasEBoot_uint16_t out_port,
VasEBoot_err_t (*recv_hook) (VasEBoot_net_udp_socket_t sock,
struct VasEBoot_net_buff *nb,
void *data),
void *recv_hook_data);
void
VasEBoot_net_udp_close (VasEBoot_net_udp_socket_t sock);
VasEBoot_err_t
VasEBoot_net_send_udp_packet (const VasEBoot_net_udp_socket_t socket,
struct VasEBoot_net_buff *nb);
#endif