-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructs.h
More file actions
33 lines (27 loc) · 703 Bytes
/
Copy pathstructs.h
File metadata and controls
33 lines (27 loc) · 703 Bytes
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
29
30
31
32
33
#ifndef STRUCTS_H
#define STRUCTS_H
#include <stdint.h>
#include <unordered_map>
#include <vector>
#include <string>
#include "utils.h"
using namespace std;
typedef struct __attribute__ ((packed)) {
char topic[MAX_TOPIC_SIZE];
uint8_t data_type;
char payload[MAX_PAYLOAD_SIZE];
} udp_message;
typedef struct __attribute__ ((packed)) {
struct sockaddr_in udp_client_addr;
char topic[MAX_TOPIC_SIZE];
uint8_t data_type;
char payload[MAX_PAYLOAD_SIZE];
} message, *Tmessage;
typedef struct {
uint8_t connected;
int socket;
struct sockaddr_in addr;
unordered_map<string, bool> *topic_sf_map;
vector<Tmessage> *stored_messages;
} client, *Tclient;
#endif