Added ARCNET raw packet handling for Linux.

This commit is contained in:
skarg
2005-09-06 20:28:52 +00:00
parent 62d3c2e45a
commit 211e0fdb34
7 changed files with 368 additions and 7 deletions
+16 -3
View File
@@ -34,15 +34,21 @@
#ifndef ARCNET_H
#define ARCNET_H
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include "bacdef.h"
// specific defines for ARCNET
#define MAX_HEADER (1+1+2+2+1+1+1+1)
#define MAX_MPDU (MAX_HEADER+MAX_PDU)
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
bool arcnet_valid(void);
bool arcnet_cleanup(void);
void arcnet_cleanup(void);
bool arcnet_init(char *interface_name);
/* function to send a packet out the 802.2 socket */
@@ -60,13 +66,20 @@ int arcnet_send_pdu(
uint8_t *pdu, // any data to be sent - may be null
unsigned pdu_len); // number of bytes of data
// receives an 802.2 framed packet
// receives an framed packet
// returns the number of octets in the PDU, or zero on failure
uint16_t arcnet_receive(
BACNET_ADDRESS *src, // source address
uint8_t *pdu, // PDU data
uint16_t max_pdu); // amount of space available in the PDU
uint16_t max_pdu, // amount of space available in the PDU
unsigned timeout); // milliseconds to wait for a packet
void arcnet_get_my_address(BACNET_ADDRESS *my_address);
void arcnet_get_broadcast_address(
BACNET_ADDRESS *dest); // destination address
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif