-
Notifications
You must be signed in to change notification settings - Fork 3
/
http.h
34 lines (30 loc) · 864 Bytes
/
http.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
/*
Duke 2016
*/
#include <errno.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#ifdef __WIN32__
#include <windows.h>
#include <winsock2.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/uio.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <netinet/tcp.h>
typedef int SOCKET;
#endif
int httpConnect(char *host);
int httpClose(SOCKET sd);
int httpSend(SOCKET sockfd, char *filename, unsigned char *data, int size, char *formname, char *path, char *host);
int httpSendRom(SOCKET sd, char *filename, unsigned char *data, int size, int slot, char *path, char *host, char *slotname);
int httpResponse(SOCKET sockfd);
int httpGet(SOCKET sd, char *host, char *url, int skipheader);