-
Notifications
You must be signed in to change notification settings - Fork 0
/
sockopt.h
34 lines (25 loc) · 883 Bytes
/
sockopt.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
29
30
31
32
33
34
#ifndef _NETWORK_SOCKOPT_H_
#define _NETWORK_SOCKOPT_H_
#include <sys/socket.h>
#include <cstddef>
#include <cstdint>
#include "networking.pb.h"
namespace NetworkSockopt {
struct SockoptParameters {
int level;
int name;
socklen_t len;
union {
int intval;
uint8_t bufval[40];
struct linger linger;
} payload;
};
bool translateSetSockoptParameters(const MsgSocketOptionSetRequest& request,
SockoptParameters& params);
bool translateGetSockoptParameters(const MsgSocketOptionGetRequest& request,
SockoptParameters& params);
void translateGetSockoptResponse(const SockoptParameters& params,
MsgSocketOptionGetResponse& response);
} // namespace NetworkSockopt
#endif