~ubuntu-branches/ubuntu/precise/getstream/precise

« back to all changes in this revision

Viewing changes to sap.h

  • Committer: Bazaar Package Importer
  • Author(s): Herve Rousseau
  • Date: 2007-05-31 17:23:59 UTC
  • Revision ID: james.westby@ubuntu.com-20070531172359-76b6p4jdyeyvno25
Tags: upstream-20070419
ImportĀ upstreamĀ versionĀ 20070419

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SAP_H
 
2
#define SAP_H 1
 
3
 
 
4
#include "getstream.h"
 
5
#include "stream.h"
 
6
 
 
7
 
 
8
struct sappkt_s {
 
9
        uint8_t version:3,
 
10
                addrtype:1,
 
11
                reserved:1,
 
12
                msgtype:1,
 
13
                encryption:1,
 
14
                compressed:1;
 
15
        uint8_t         authlen;
 
16
        uint16_t        msgidhash;
 
17
        uint32_t        origin;
 
18
};
 
19
 
 
20
struct sap_s {
 
21
        /* Config items */
 
22
        char                    *scope;
 
23
        char                    *group;
 
24
        int                     port;
 
25
 
 
26
        char                    *announcehost;
 
27
        int                     announceport;
 
28
        char                    *playgroup;
 
29
 
 
30
        /* SAP socket port and address */
 
31
        int                     fd,
 
32
                                ttl;
 
33
 
 
34
        struct event            event;
 
35
 
 
36
        char                    *name;  /* Session Name */
 
37
        char                    *cdata; /* Connection Data RFC2327 */
 
38
        char                    *mdata; /* Media Announcement Data RFC2327 */
 
39
        char                    *odata; /* Origin Data RFC2327 */
 
40
 
 
41
        uint32_t                addr;   /* For the SAP header */
 
42
 
 
43
        struct stream_s         *stream;
 
44
};
 
45
 
 
46
#define SAP_ADDRTYPE_V4         0
 
47
#define SAP_ADDRTYPE_V6         1
 
48
 
 
49
#define SAP_MSGTYPE_ANNOUNCE    1
 
50
#define SAP_MSGTYPE_DELETE      0
 
51
 
 
52
#define SAP_V4_GLOBAL_ADDRESS   "224.2.127.254"
 
53
#define SAP_V4_ORG_ADDRESS      "239.195.255.255" /* Organization-local SAP address */
 
54
#define SAP_V4_LOCAL_ADDRESS    "239.255.255.255" /* Local (smallest non-link-local scope) SAP address */
 
55
#define SAP_V4_LINK_ADDRESS     "224.0.0.255"   /* Link-local SAP address */
 
56
 
 
57
#define SAP_TTL         15
 
58
#define SAP_PORT        9875                            /* As per RFC 2974 */
 
59
#define SAP_MAX_SIZE    1024                            /* As per RFC 2974 */
 
60
 
 
61
int sap_init(struct channel_s *channel);
 
62
 
 
63
#endif