Statistics
| Branch: | Revision:

grapes / include / peer.h @ master

History | View | Annotate | Download (679 Bytes)

1
/**
2
 * @file:   peer.h
3
 * @brief Peer structure definition.
4
 * @author: Alessandro Russo <russo@disi.unitn.it>
5
 * @author: Luca Baldesi <luca.baldesi@unitn.it>
6
 *
7
 */
8

    
9
#ifndef _PEER_H
10
#define        _PEER_H
11

    
12
#include <sys/time.h>
13

    
14
struct peer {
15
    /* Peer identifier, the nodeid associated with the peer */
16
    struct nodeID *id;
17

    
18
    /* Peer creation time */
19
    struct timeval creation_timestamp; 
20

    
21
    /* User defined data to be broadcasted in the network */
22
    void * metadata; 
23

    
24
    /* User defined data not to be sent over the network */
25
    void * user_data;
26
};
27

    
28
typedef void (*peer_deinit_f)(struct peer *p);
29
typedef void (*peer_init_f)(struct peer *p);
30

    
31
#endif        /* _PEER_H */