PageRenderTime 17ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/sap.h

https://bitbucket.org/a84/gs_public/
C++ Header | 74 lines | 55 code | 17 blank | 2 comment | 0 complexity | 0efc128082e3f42d13a5932a94e39a87 MD5 | raw file
 1#ifndef SAP_H
 2#define SAP_H 1
 3
 4#include "getstream.h"
 5#include "output.h"
 6
 7struct sappkt_s {
 8	uint8_t	version:3,
 9		addrtype:1,
10		reserved:1,
11		msgtype:1,
12		encryption:1,
13		compressed:1;
14	uint8_t		authlen;
15	uint16_t	msgidhash;
16	uint32_t	origin;
17};
18
19struct sap_s {
20	/* Config items */
21	int			scope;
22	char			*group;
23	int			port;
24
25	char			*announcehost;
26	int			announceport;
27	char			*playgroup;
28
29	int			interval;
30
31	char			*uri;
32	char			*description;
33	GList			*emaillist;
34	GList			*phonelist;
35	GList			*attributelist;
36
37	/* SAP socket port and address */
38	int			fd,
39				ttl;
40
41	struct event		event;
42
43	int			sid;	/* Session Identifier */
44	char			*name;	/* Session Name */
45	char			*cdata;	/* Connection Data RFC2327 */
46	char			*mdata;	/* Media Announcement Data RFC2327 */
47	char			*odata;	/* Origin Data RFC2327 */
48
49	uint32_t		originatingaddr; /* Originating Address for the SAP header */
50
51	struct output_s		*output;
52};
53
54#define SAP_ADDRTYPE_V4		0
55#define SAP_ADDRTYPE_V6		1
56
57#define SAP_MSGTYPE_ANNOUNCE	1
58#define SAP_MSGTYPE_DELETE	0
59
60#define SAP_TTL		15
61#define SAP_PORT	9875				/* As per RFC 2974 */
62#define SAP_MAX_SIZE	1024				/* As per RFC 2974 */
63
64int sap_init(struct sap_s *sap);
65
66enum {
67	SAP_SCOPE_NONE = 0,
68	SAP_SCOPE_GLOBAL,
69	SAP_SCOPE_ORG,
70	SAP_SCOPE_LOCAL,
71	SAP_SCOPE_LINK
72};
73
74#endif