-
Notifications
You must be signed in to change notification settings - Fork 0
/
sniffer.h
28 lines (24 loc) · 982 Bytes
/
sniffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <string>
#include <set>
namespace Sniffer {
class SimBroadcast;
int init_multicast_socket(const char* addr, int port);
char* getSimNameFromPath(char* path);
void parse_broadcast(char* info[10], char* databuf);
void get_list(std::set<SimBroadcast> &vsset, const int sd);
std::ostream& operator<<(std::ostream& os, const SimBroadcast& sb);
bool operator==(const SimBroadcast& l, const SimBroadcast& r);
bool operator<(const SimBroadcast& l, const SimBroadcast& r);
}
class Sniffer::SimBroadcast {
public:
SimBroadcast(char* host, char* port, char* sim_name, char* input_file );
friend std::ostream& operator<<(std::ostream& os, const SimBroadcast& sb);
friend bool operator==(const SimBroadcast& l, const SimBroadcast& r);
friend bool operator<(const SimBroadcast& l, const SimBroadcast& r);
std::string host;
std::string port;
std::string sim_name;
std::string input_file;
char c_str[128] = {};
};