Statistics
| Branch: | Revision:

pstreamer / src / peer_metadata.h @ dc99f5c4

History | View | Annotate | Download (1.23 KB)

1
/*
2
 * Copyright (c) 2017 Luca Baldesi
3
 *
4
 * This file is part of PeerStreamer.
5
 *
6
 * PeerStreamer is free software: you can redistribute it and/or
7
 * modify it under the terms of the GNU Affero General Public License as
8
 * published by the Free Software Foundation, either version 3 of the
9
 * License, or (at your option) any later version.
10
 *
11
 * PeerStreamer is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero
14
 * General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Affero General Public License
17
 * along with PeerStreamer.  If not, see <http://www.gnu.org/licenses/>.
18
 *
19
 */
20

    
21
#ifndef __PEER_METADATA_H__
22
#define __PEER_METADATA_H__
23

    
24
#include<stdint.h>
25
#include<peer.h>
26

    
27
#define DEFAULT_PEER_CBSIZE 50
28
#define DEFAULT_PEER_NEIGH_SIZE 30
29

    
30
struct metadata {
31
  uint16_t cb_size;
32
  uint8_t neigh_size;
33
} __attribute__((packed));
34

    
35

    
36
int8_t metadata_update(struct metadata *m, uint16_t cb_size, uint8_t neigh_size);
37

    
38
int8_t peer_set_metadata(struct  peer *p, const struct metadata *m);
39

    
40
uint16_t peer_cb_size(const struct peer *p);
41

    
42
uint16_t peer_neigh_size(const struct peer *p);
43

    
44
#endif