win32/nicdrv.h
Go to the documentation of this file.
1 /*
2  * Licensed under the GNU General Public License version 2 with exceptions. See
3  * LICENSE file in the project root for full license information
4  */
5 
11 #ifndef _nicdrvh_
12 #define _nicdrvh_
13 
14 #ifdef __cplusplus
15 extern "C"
16 {
17 #endif
18 
19 #define HAVE_REMOTE
20 
21 #include <pcap.h>
22 #include <Packet32.h>
23 
25 typedef struct
26 {
28  pcap_t **sock;
32  int (*txbuflength)[EC_MAXBUF];
34  ec_bufT *tempbuf;
38  int (*rxbufstat)[EC_MAXBUF];
40  int (*rxsa)[EC_MAXBUF];
41 } ec_stackT;
42 
44 typedef struct
45 {
46  ec_stackT stack;
47  pcap_t *sockhandle;
51  int rxbufstat[EC_MAXBUF];
53  int rxsa[EC_MAXBUF];
55  ec_bufT tempinbuf;
56 } ecx_redportt;
57 
59 typedef struct
60 {
61  ec_stackT stack;
62  pcap_t *sockhandle;
66  int rxbufstat[EC_MAXBUF];
68  int rxsa[EC_MAXBUF];
70  ec_bufT tempinbuf;
72  int tempinbufs;
76  int txbuflength[EC_MAXBUF];
78  ec_bufT txbuf2;
80  int txbuflength2;
82  int lastidx;
84  int redstate;
86  ecx_redportt *redport;
87  CRITICAL_SECTION getindex_mutex;
88  CRITICAL_SECTION tx_mutex;
89  CRITICAL_SECTION rx_mutex;
90 } ecx_portt;
91 
92 extern const uint16 priMAC[3];
93 extern const uint16 secMAC[3];
94 
95 #ifdef EC_VER1
96 extern ecx_portt ecx_port;
98 
99 int ec_setupnic(const char * ifname, int secondary);
100 int ec_closenic(void);
101 void ec_setbufstat(int idx, int bufstat);
102 int ec_getindex(void);
103 int ec_outframe(int idx, int sock);
104 int ec_outframe_red(int idx);
105 int ec_waitinframe(int idx, int timeout);
106 int ec_srconfirm(int idx,int timeout);
107 #endif
108 
109 void ec_setupheader(void *p);
110 int ecx_setupnic(ecx_portt *port, const char * ifname, int secondary);
111 int ecx_closenic(ecx_portt *port);
112 void ecx_setbufstat(ecx_portt *port, int idx, int bufstat);
113 int ecx_getindex(ecx_portt *port);
114 int ecx_outframe(ecx_portt *port, int idx, int sock);
115 int ecx_outframe_red(ecx_portt *port, int idx);
116 int ecx_waitinframe(ecx_portt *port, int idx, int timeout);
117 int ecx_srconfirm(ecx_portt *port, int idx,int timeout);
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif
int ec_outframe(int idx, int sock)
int ecx_closenic(ecx_portt *port)
Definition: erika/nicdrv.c:140
int ec_setupnic(const char *ifname, int secondary)
uint8 txbuf[1024]
Definition: eoe_test.c:40
struct pcap pcap_t
Definition: pcap/pcap.h:87
#define EC_MAXBUF
Definition: ethercattype.h:62
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
Definition: erika/nicdrv.c:90
CRITICAL_SECTION tx_mutex
Definition: win32/nicdrv.h:88
uint16_t uint16
Definition: osal.h:29
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:490
int ecx_outframe(ecx_portt *port, int idx, int sock)
Definition: erika/nicdrv.c:215
ecx_portt ecx_port
Definition: ethercatmain.c:97
int ec_srconfirm(int idx, int timeout)
CRITICAL_SECTION getindex_mutex
Definition: win32/nicdrv.h:87
int ecx_outframe_red(ecx_portt *port, int idx)
Definition: erika/nicdrv.c:237
void ec_setbufstat(int idx, int bufstat)
int ecx_getindex(ecx_portt *port)
Definition: erika/nicdrv.c:168
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
Definition: erika/nicdrv.c:202
struct ecx_port ecx_portt
ecx_redportt ecx_redport
Definition: ethercatmain.c:98
int ec_outframe_red(int idx)
uint8 ec_bufT[EC_BUFSIZE]
Definition: ethercattype.h:87
int ec_closenic(void)
const uint16 secMAC[3]
Definition: erika/nicdrv.c:67
int ec_getindex(void)
const uint16 priMAC[3]
Definition: erika/nicdrv.c:65
int ec_waitinframe(int idx, int timeout)
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:467
struct ecx_redport ecx_redportt
void ec_setupheader(void *p)
Definition: erika/nicdrv.c:151
CRITICAL_SECTION rx_mutex
Definition: win32/nicdrv.h:89
uint8 rxbuf[1024]
Definition: eoe_test.c:50


soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Sat Jun 27 2020 03:48:21