Blame view

check_upnp/udp.h 496 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef UDP_H
#define UDP_H

#include <iostream>

#include <string.h>
#include <cstdlib>

#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>

#define MAX_UDP 65507

using namespace std;

void setupSocket(uint16_t port, char *hostname, struct hostent *host, int timeout, struct sockaddr_in *si, int *s);
int sendMsg(int s, char *msg, size_t msgLength, struct sockaddr_in *si);
int recvMsg(int s, char *msg, size_t msgLength, struct sockaddr_in *si);

#endif