Blame view

check_tftp/udp.h 473 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
#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>

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