Statistics
| Branch: | Revision:

peerstreamer-src / src / pschannel.h @ cea8d274

History | View | Annotate | Download (2.17 KB)

1
/*******************************************************************
2
* PeerStreamer-ng is a P2P video streaming application exposing a ReST
3
* interface.
4
* Copyright (C) 2017 Luca Baldesi <luca.baldesi@unitn.it>
5
*
6
* This program is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU Affero General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program 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
14
* GNU Affero General Public License for more details.
15
*
16
* You should have received a copy of the GNU Affero General Public License
17
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
*******************************************************************/
19

    
20
#ifndef __PSCHANNEL_H__
21
#define __PSCHANNEL_H__
22

    
23
#include<stdint.h>
24
#include<name_lengths.h>
25
#include<pstreamer.h>
26

    
27
struct pschannel {
28
        char name[MAX_NAME_LENGTH];
29
        char ipaddr[MAX_IPADDR_LENGTH];
30
        char port[MAX_PORT_LENGTH];
31
        char quality[MAX_QUALITY_LENGTH];
32
        char sdpfile[MAX_SDPFILENAME_LENGTH];
33
};
34

    
35
struct pschannel_bucket;
36
struct pstreamer_manager;
37

    
38
struct pschannel_bucket * pschannel_bucket_new(const char * csvfilename, const struct pstreamer_manager * psm);
39

    
40
uint8_t pschannel_bucket_insert(struct pschannel_bucket * pb, const char * name, const char * ip, const char * port, const char * quality, const char * sdpfile);
41

    
42
const struct pschannel * pschannel_bucket_iter(const struct pschannel_bucket * pb, const struct pschannel * iter);
43

    
44
void pschannel_bucket_destroy(struct pschannel_bucket ** pb);
45

    
46
char * pschannel_bucket_to_json(const struct pschannel_bucket * pb);
47

    
48
const struct pschannel * pschannel_bucket_find(const struct pschannel_bucket * psb, const char * ipaddr, const char * port);
49

    
50
int8_t pschannel_bucket_loadfile(struct pschannel_bucket * psb);
51

    
52
int8_t pschannel_bucket_load_local_streams(struct pschannel_bucket * pb);
53

    
54
int8_t pschannel_bucket_reset(struct pschannel_bucket * psb);
55

    
56
int8_t pschannel_bucket_save2file(struct pschannel_bucket * psb);
57

    
58
#endif