-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpeer_api.h
36 lines (24 loc) · 1.06 KB
/
peer_api.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
35
36
#ifndef PEER_API_H_INCLUDED
#define PEER_API_H_INCLUDED
#include <stdint.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "Estruturas/headed_list.h"
int PEER_ID;
struct sockaddr_in GATEWAY_SOCKADDR;
void freePhoto(void * item);
int comparePhotoWithPhotoId(void * a, void * b);
int registerAtGateway(int fd, struct sockaddr_in gateway_addr, in_port_t peer_port, struct in_addr peer_addr);
int unregisterAtGateway(int fd, struct sockaddr_in gateway_addr, int peer_id);
int sendPhotoList(int fd, List * photos_list);
int receivePhotoList(int fd, List ** photo_list);
int handle_new_photo(int fd, List * photos_list);
int handle_add_keyword(int fd, List * photos_list);
int handle_search_photo(int fd, List * photos_list);
int handle_delete_photo(int fd, List * photos_list);
int handle_get_photo_name(int fd, List * photos_list);
int handle_get_photo(int fd, List * photos_list);
int handle_replica_new_photo(int fd, List * photos_list);
int handle_replica_add_keyword(int fd, List * photos_list);
int handle_replica_delete_photo(int fd, List * photos_list);
#endif