Sha256: 2ca3ae234d55d9196dee0c82bf6fc7d2b82556c3e755189b603b3e96359a1ec0

Contents?: true

Size: 1.35 KB

Versions: 23

Compression:

Stored size: 1.35 KB

Contents

/*
  Copyright (C) 2009-2012 NEC Corporation

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2, as
  published by the Free Software Foundation.

  This program 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 this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef _UDP_H_
#define _UDP_H_

#include "ipv4.h"

#define UDP_SRC_PORT_LEN 2
#define UDP_DST_PORT_LEN 2
#define UDP_LEN_LEN 2
#define UDP_CHECKSUM_LEN 2

#define UDP_HDR_LEN 8

typedef struct udp {
    uint16_t src;
    uint16_t dst;
    uint32_t payload_length;
    uint8_t *payload;
} udp;

int udp_init(void *recv_callback);
int udp_set_recv_callback(void *callback);
int udp_handle_message(ipv4 *ip);
udp *udp_create(uint16_t src, uint16_t dst, uint8_t *payload,
                uint32_t payload_length);
udp *udp_create_from_raw(uint8_t *packet, uint32_t length);
int udp_destroy(udp *udp);
uint8_t *udp_get_packet(udp *udp, uint8_t *buffer, uint32_t *length);

#endif /* _UDP_H_ */

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trema-0.3.9 vendor/phost/src/udp.h
trema-0.3.8 vendor/phost/src/udp.h
trema-0.3.7 vendor/phost/src/udp.h
trema-0.3.6 vendor/phost/src/udp.h
trema-0.3.5 vendor/phost/src/udp.h
trema-0.3.4 vendor/phost/src/udp.h
trema-0.3.3 vendor/phost/src/udp.h
trema-0.3.2 vendor/phost/src/udp.h
trema-0.3.1 vendor/phost/src/udp.h
trema-0.3.0 vendor/phost/src/udp.h
trema-0.2.8 vendor/phost/src/udp.h
trema-0.2.7 vendor/phost/src/udp.h
trema-0.2.6 vendor/phost/src/udp.h
trema-0.2.5 vendor/phost/src/udp.h
trema-0.2.4 vendor/phost/src/udp.h
trema-0.2.3 vendor/phost/src/udp.h
trema-0.2.2.1 vendor/phost/src/udp.h
trema-0.2.2 vendor/phost/src/udp.h
trema-0.2.1 vendor/phost/src/udp.h
trema-0.2.0 vendor/phost/src/udp.h