Statistics
| Branch: | Revision:

grapes / include / net_helper.h @ 0567c2b4

History | View | Annotate | Download (799 Bytes)

1
#ifndef NET_HELPER_H
2
#define NET_HELPER_H
3

    
4
struct nodeID;
5

    
6
struct nodeID *nodeid_dup(const struct nodeID *s);
7
int nodeid_equal(const struct nodeID *s1, const struct nodeID *s2);
8

    
9
struct nodeID *create_node(const char *IPaddr, int port);
10
void nodeid_free(struct nodeID *s);
11
struct nodeID *net_helper_init(const char *IPaddr, int port);
12
int send_to_peer(const struct nodeID *from, struct nodeID *to, const uint8_t *buffer_ptr, int buffer_size);
13
int recv_from_peer(const struct nodeID *local, struct nodeID **remote, uint8_t *buffer_ptr, int buffer_size);
14

    
15
int wait4data(const struct nodeID *n, struct timeval tout);
16

    
17
const char *node_addr(const struct nodeID *s);
18
struct nodeID *nodeid_undump(const uint8_t *b, int *len);
19
int nodeid_dump(uint8_t *b, const struct nodeID *s);
20
#endif /* NET_HELPER_H */