OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
generic_networkhandler.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2009, Rockwell Automation, Inc.
3  * All rights reserved.
4  *
5  ******************************************************************************/
6 
14 #ifndef GENERIC_NETWORKHANDLER_H_
15 #define GENERIC_NETWORKHANDLER_H_
16 
17 #include <stdio.h>
18 #include <string.h>
19 #include <stdlib.h>
20 #include <errno.h>
21 
22 #include "opener_api.h"
23 #include "typedefs.h"
24 #include "endianconv.h"
25 #include "cipconnectionmanager.h"
26 #include "networkhandler.h"
27 #include "appcontype.h"
28 #include "socket_timer.h"
29 
31 
32 //EipUint8 g_ethernet_communication_buffer[PC_OPENER_ETHERNET_BUFFER_SIZE]; /**< communication buffer */
33 
35 fd_set read_socket;
36 
44 
45 struct timeval g_time_value;
51 typedef struct {
57 
65 
66 void CloseUdpSocket(int socket_handle);
67 
68 void CloseTcpSocket(int socket_handle);
69 
70 
76 
78 
80 
85 EipBool8 CheckSocketSet(int socket);
86 
95 int GetMaxSocket(int socket1,
96  int socket2,
97  int socket3,
98  int socket4);
99 
100 #endif /* GENERIC_NETWORKHANDLER_H_ */
#define OPENER_NUMBER_OF_SUPPORTED_SESSIONS
Number of sessions that can be handled at the same time.
MilliSeconds g_actual_time
Data structure to store last usage times for sockets.
Definition: socket_timer.h:15
void CloseTcpSocket(int socket_handle)
MilliSeconds g_last_time
Responsible for Endianess conversion.
SocketTimer g_timestamps[OPENER_NUMBER_OF_SUPPORTED_SESSIONS]
struct timeval g_time_value
int GetMaxSocket(int socket1, int socket2, int socket3, int socket4)
Returns the socket with the highest id.
EipBool8 CheckSocketSet(int socket)
check if the given socket is set in the read set
EipStatus
EIP stack status enum.
Definition: typedefs.h:93
EipStatus NetworkHandlerInitialize(void)
The platform independent part of network handler initialization routine.
int highest_socket_handle
NetworkStatus g_network_status
EipStatus NetworkHandlerProcessOnce(void)
Struct representing the current network status.
int g_current_active_tcp_socket
This variable holds the TCP socket the received to last explicit message. It is needed for opening po...
EipStatus NetworkHandlerFinish(void)
fd_set master_socket
uint8_t EipBool8
Definition: typedefs.h:37
MilliSeconds elapsed_time
void CloseUdpSocket(int socket_handle)
unsigned long MilliSeconds
Definition: typedefs.h:68
fd_set read_socket