Blame view

check_tftp/check_tftp.h 704 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef CHECK_TFTP_H
#define CHECK_TFTP_H

#include <iostream>
#include <sstream>

#include <stdio.h>
#include <cstring>
#include <cstdlib>
#include <unistd.h>

#include <sys/time.h>
Imanol-Mikel Barba Sabariego authored
14
#include "auxiliar.h"
Imanol-Mikel Barba Sabariego authored
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "udp.h"

#define DEFAULT_PORT 	69 //SEXY PROGRAMMING...
#define VERSION 	"1.0"
#define BUFSIZE		512
#define RRQ		1
#define DATA		3
#define ACK		4
#define	MODE_OCTAL	(char*)"octet"

using namespace std;

uint8_t recvFile(char *filename, string *error, int s, struct sockaddr_in *si);
uint8_t sendACK(uint16_t numBlock, int s, struct sockaddr_in *si);
uint8_t sendRRQ(char *filename, char *mode, int s, struct sockaddr_in *si);
void printVersion();
void printHelp(bool longVersion);

#endif