9 #ifndef GIGEINTERFACE_H
10 #define GIGEINTERFACE_H
15 #include <sys/types.h>
16 #include <sys/socket.h>
17 #include <netinet/in.h>
57 std::string
parseInput(std::string& ) {
return std::string(); }
70 void pump_messages ();
71 int send_ack (
const void *pbuf,
int len, sockaddr_in *psockaddr);
73 void sync_net(
bool init_cfg_reg =
false);
76 void sync_user_name();
79 uint32_t* createDiscoveryAckPacket (
int &len,
GEV_STATUS status, uint16_t ackid);
80 uint32_t* createReadRegAckPacket (
int &len,
GEV_STATUS status, uint16_t ackid, uint32_t address, uint32_t nvalue);
81 uint32_t* createWriteRegAckPacket (
int &len,
GEV_STATUS status, uint16_t ackid);
82 uint32_t* createReadMemAckPacket (
int &len,
GEV_STATUS status, uint16_t ackid, uint32_t address, uint16_t numbytes, uint8_t* data);
83 uint32_t* createWriteMemAckPacket (
int &len,
GEV_STATUS status, uint16_t ackid);
84 uint32_t* createForceIpAckPacket (
int &len,
GEV_STATUS status, uint16_t ackid);
86 GEV_STATUS execWriteRegCmd (uint32_t address, uint32_t nvalue);
87 GEV_STATUS execWriteMemCmd (uint32_t address,
const uint8_t* data, uint32_t numbytes);
88 GEV_STATUS execForceIpCmd (uint32_t ipaddr, uint32_t snmask, uint32_t gwaddr);
90 void releaseAccess ();
92 bool is_access_client (
const sockaddr_in &sa) {
return (m_AccessControlled && sa.sin_addr.s_addr == mnAccessingClientIP && sa.sin_port == mnAccessingClientPort); }
93 bool is_access_controlled () {
return m_AccessControlled; }
94 bool is_access_exclusive () {
return m_AccessExclusive; }
98 sockaddr_in si_broadcast;
102 uint16_t mnPreviousAckID;
105 struct timespec mnPreviousTime;
106 unsigned int mnHeartBeatTimer;
107 uint16_t mnWriteMemIndex;
109 bool m_AccessControlled;
110 bool m_AccessExclusive ;
111 in_addr_t mnAccessingClientIP;
112 in_port_t mnAccessingClientPort;
114 uint8_t m_macaddr[6];
118 #endif // GIGEINTERFACE_H