sensor_api
source
Utilities
Legacy
FirmwareUpdateUtility
Ip.hh
Go to the documentation of this file.
1
37
#ifdef WIN32
38
#ifndef WIN32_LEAN_AND_MEAN
39
#define WIN32_LEAN_AND_MEAN 1
40
#endif
41
#define INET_ADDRSTRLEN 16
42
#include <WinSock2.h>
43
#include <Windows.h>
44
typedef
SOCKET
socket_t
;
45
46
#else
47
#include <unistd.h>
48
#include <sys/ioctl.h>
49
#include <sys/socket.h>
50
#include <sys/sendfile.h>
51
#include <sys/un.h>
52
#include <netinet/in.h>
53
#include <netdb.h>
54
#include <arpa/inet.h>
55
#include <sys/wait.h>
56
#include <ifaddrs.h>
57
#include <netinet/udp.h>
58
#include <sys/time.h>
59
typedef
int
socket_t
;
60
#endif
61
62
63
64
#include <stdio.h>
65
#include <stdlib.h>
66
#include <errno.h>
67
#include <fcntl.h>
68
#include <string.h>
69
#include <sys/types.h>
70
#include <signal.h>
71
#include <string>
72
73
#include <
MultiSense/details/utility/Portability.hh
>
74
75
class
Ip
76
{
77
78
public
:
79
Ip
()
80
{
81
82
}
83
int
Bind
();
84
int
Setup
(std::string _IpAddress);
85
~Ip
()
86
{
87
if
(
m_SockFd
> 0)
88
{
89
closesocket
(
m_SockFd
);
90
}
91
92
m_Connected
= 0;
93
}
94
95
socket_t
Sock
( )
96
{
97
return
m_SockFd
;
98
}
99
100
struct
sockaddr_in
Server
()
101
{
102
return
m_ServerAddress
;
103
}
104
105
private
:
106
107
socket_t
m_SockFd
;
108
struct
sockaddr_in
m_ClientAddress
;
109
struct
sockaddr_in
m_ServerAddress
;
110
std::string
m_IpAddress
;
111
int
m_Connected
;
112
};
Ip
Definition:
Ip.hh:75
Ip::Setup
int Setup(std::string _IpAddress)
Definition:
Ip.cc:113
socket_t
int socket_t
Definition:
Ip.hh:59
Ip::m_SockFd
socket_t m_SockFd
Definition:
Ip.hh:107
Portability.hh
Ip::m_IpAddress
std::string m_IpAddress
Definition:
Ip.hh:110
Ip::Server
struct sockaddr_in Server()
Definition:
Ip.hh:100
closesocket
#define closesocket
Definition:
Legacy/include/MultiSense/details/utility/Portability.hh:103
Ip::m_ClientAddress
struct sockaddr_in m_ClientAddress
Definition:
Ip.hh:108
Ip::Sock
socket_t Sock()
Definition:
Ip.hh:95
Ip::Ip
Ip()
Definition:
Ip.hh:79
Ip::Bind
int Bind()
Definition:
Ip.cc:43
Ip::m_Connected
int m_Connected
Definition:
Ip.hh:111
Ip::~Ip
~Ip()
Definition:
Ip.hh:85
Ip::m_ServerAddress
struct sockaddr_in m_ServerAddress
Definition:
Ip.hh:109
multisense_lib
Author(s):
autogenerated on Thu Apr 17 2025 02:49:09