Statistics
| Branch: | Revision:

grapes / include / net_helper.h @ 458b1d7e

History | View | Annotate | Download (831 Bytes)

1
#ifndef NET_HELPER_H
2
#define NET_HELPER_H
3

    
4
struct nodeID;
5

    
6
struct nodeID *nodeid_dup(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
void bind_msg_type (uint8_t msgtype);
13
int send_to_peer(const struct nodeID *from, struct nodeID *to, const uint8_t *buffer_ptr, int buffer_size);
14
int recv_from_peer(const struct nodeID *local, struct nodeID **remote, uint8_t *buffer_ptr, int buffer_size);
15

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

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