mikroSDK Reference Manual
pcap_driver.h
Go to the documentation of this file.
1
31#ifndef _PCAP_DRIVER_H
32#define _PCAP_DRIVER_H
33
34//Dependencies
35#include "core/nic.h"
36
37//Maximum packet size
38#ifndef PCAP_DRIVER_MAX_PACKET_SIZE
39 #define PCAP_DRIVER_MAX_PACKET_SIZE 1536
40#elif (PCAP_DRIVER_MAX_PACKET_SIZE < 1)
41 #error PCAP_DRIVER_MAX_PACKET_SIZE parameter is not valid
42#endif
43
44//Maximum number of packets in the receive queue
45#ifndef PCAP_DRIVER_QUEUE_SIZE
46 #define PCAP_DRIVER_QUEUE_SIZE 64
47#elif (PCAP_DRIVER_QUEUE_SIZE < 1)
48 #error PCAP_DRIVER_QUEUE_SIZE parameter is not valid
49#endif
50
51//Receive timeout in milliseconds
52#ifndef PCAP_DRIVER_TIMEOUT
53 #define PCAP_DRIVER_TIMEOUT 1
54#elif (PCAP_DRIVER_TIMEOUT < 1)
55 #error PCAP_DRIVER_TIMEOUT parameter is not valid
56#endif
57
58//C++ guard
59#ifdef __cplusplus
60extern "C" {
61#endif
62
63//PCAP driver
64extern const NicDriver pcapDriver;
65
66//PCAP related functions
67error_t pcapDriverInit(NetInterface *interface);
68
69void pcapDriverTick(NetInterface *interface);
70
71void pcapDriverEnableIrq(NetInterface *interface);
72void pcapDriverDisableIrq(NetInterface *interface);
73
74void pcapDriverEventHandler(NetInterface *interface);
75
76error_t pcapDriverSendPacket(NetInterface *interface,
77 const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary);
78
79error_t pcapDriverUpdateMacAddrFilter(NetInterface *interface);
80
81void pcapDriverTask(NetInterface *interface);
82
83//C++ guard
84#ifdef __cplusplus
85}
86#endif
87
88#endif
error_t
Error codes.
Definition error.h:43
Network interface controller abstraction layer.
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
NIC driver.
Definition nic.h:283