31 lines
996 B
C
31 lines
996 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#ifndef MARS_IPXPKT_H
|
|
#define MARS_IPXPKT_H
|
|
/* Visual C++ 6 (Windows 95 / NT4) has no stdint.h. */
|
|
#if defined(_MSC_VER) && _MSC_VER < 1600
|
|
typedef unsigned char uint8_t;
|
|
typedef unsigned short uint16_t;
|
|
typedef unsigned long uint32_t;
|
|
#else
|
|
#include <stdint.h>
|
|
#endif
|
|
#include <stddef.h>
|
|
#include <time.h>
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#define PKT_TRAIL 0x6181
|
|
#define PKT_PLAIN 0x6180
|
|
#define PKT_FRAME 1514
|
|
#define PKT_SLOTS 32
|
|
struct pkt_piece { uint16_t len; uint8_t bytes[542]; };
|
|
struct pkt_slot { uint8_t node[6], total, mask; uint32_t net; uint16_t port,id; time_t until; struct pkt_piece part[3]; };
|
|
struct pkt_rx { struct pkt_slot slots[PKT_SLOTS]; };
|
|
int pkt_receive(struct pkt_rx *,uint32_t,const uint8_t[6],uint16_t,const uint8_t*,size_t,time_t,uint8_t[PKT_FRAME]);
|
|
typedef int (*pkt_emit)(void*,const uint8_t*,size_t);
|
|
int pkt_send(uint16_t,uint16_t,const uint8_t*,size_t,pkt_emit,void*);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|