14 #ifndef __INCLUDED_SCOPIRA_TOOL_NETFLOW_H__ 15 #define __INCLUDED_SCOPIRA_TOOL_NETFLOW_H__ 19 #include <scopira/tool/export.h> 20 #include <scopira/tool/array.h> 21 #include <scopira/tool/flow.h> 22 #include <scopira/tool/platform.h> 29 typedef SOCKET socket_handle_t;
31 typedef int socket_handle_t;
66 SCOPIRA_EXPORT
netaddr(
int _ip0,
int _ip1,
int _ip2,
int _ip3);
71 static netaddr
any(
void) {
return zero(); }
78 SCOPIRA_EXPORT std::string
as_string(
void)
const;
95 typedef std::list < std::string > strlist_t;
96 typedef std::list < netaddr > addrlist_t;
107 SCOPIRA_EXPORT
virtual ~nethostrec(
void);
110 SCOPIRA_EXPORT
void clear(
void);
113 SCOPIRA_EXPORT
const netaddr & get_addr(
void)
const;
131 socket_handle_t dm_sock;
161 SCOPIRA_EXPORT netflow(
const netaddr * _addr,
int _port,
int socket_options = 0);
163 SCOPIRA_EXPORT
virtual ~netflow();
166 SCOPIRA_EXPORT
virtual bool failed(
void)
const;
169 SCOPIRA_EXPORT
virtual size_t read(
byte_t* _buf,
size_t _maxsize);
171 SCOPIRA_EXPORT
virtual size_t write(
const byte_t* _buf,
size_t _size);
176 SCOPIRA_EXPORT
size_t read_short(
byte_t* _buf,
size_t _maxsize);
184 SCOPIRA_EXPORT
void open(
const netaddr * _addr,
int _port,
int socket_options = 0);
186 SCOPIRA_EXPORT
void close(
void);
190 SCOPIRA_EXPORT
bool accept(netflow& nconn);
202 SCOPIRA_EXPORT
bool read_ready(
int msec);
211 SCOPIRA_EXPORT
void open_relay(socket_handle_t _fd,
const flow_i::byte_t* _addr,
int _addrlen,
int _port);
230 #ifdef PLATFORM_win32 234 SCOPIRA_EXPORT ~net_loop();
236 SCOPIRA_EXPORT net_loop(
void) { }
255 SCOPIRA_EXPORT udpflow(
int _port);
257 SCOPIRA_EXPORT
virtual ~udpflow();
260 bool failed(
void)
const {
return dm_fail; }
267 SCOPIRA_EXPORT
size_t read(
netaddr &actualsrc,
int &actualport, byte_t* _buf,
size_t _maxsize);
271 SCOPIRA_EXPORT
size_t write(
netaddr dest,
int destport,
const byte_t* _buf,
size_t _size);
274 SCOPIRA_EXPORT
void open(
int _port);
276 SCOPIRA_EXPORT
void close(
void);
280 SCOPIRA_EXPORT
bool read_ready(
int msec);
287 socket_handle_t dm_sock;
292 #ifndef PLATFORM_win32 304 std::string dm_filename;
305 bool dm_server, dm_open, dm_fail, dm_sfail;
312 unixflow(
const std::string &filename,
bool server_mode);
317 virtual bool failed(
void)
const;
320 virtual size_t read(
byte_t* _buf,
size_t _maxsize);
322 virtual size_t write(
const byte_t* _buf,
size_t _size);
325 void open(
const std::string &filename,
bool server_mode);
335 bool read_ready(
int msec);
344 void open_relay(
int _fd,
const std::string &filename);
346 #endif //PLATFORM_win32
Definition: archiveflow.h:20