icecasttypes.h 3.37 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
/* Icecast
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
 * Copyright 2018,      Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
 */

#ifndef __ICECASTTYPES_H__
#define __ICECASTTYPES_H__

12 13 14 15
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#include "compat.h"

/* ---[ client.[ch] ]--- */

typedef struct _client_tag client_t;

/* ---[ source.[ch] ]--- */

typedef struct source_tag source_t;

/* ---[ admin.[ch] ]--- */

/* Command IDs */
typedef int32_t admin_command_id_t;

/* formats */
typedef enum {
    ADMIN_FORMAT_AUTO,
    ADMIN_FORMAT_RAW,
35
    ADMIN_FORMAT_HTML,
36 37 38 39 40 41 42 43 44 45
    ADMIN_FORMAT_PLAINTEXT
} admin_format_t;

/* ---[ acl.[ch] ]--- */

typedef struct acl_tag acl_t;

/* ---[ auth.[ch] ]--- */

typedef struct auth_tag auth_t;
46
typedef struct auth_stack_tag auth_stack_t;
47

48 49 50
/* ---[ cfgfile.[ch] ]--- */

typedef struct ice_config_tag ice_config_t;
51

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
typedef struct _config_options config_options_t;

typedef enum _operation_mode {
 /* Default operation mode. may depend on context */
 OMODE_DEFAULT = 0,
 /* The normal mode. */
 OMODE_NORMAL,
 /* Mimic some of the behavior of older versions.
  * This mode should only be used in transition to normal mode,
  * e.g. to give some clients time to upgrade to new API.
  */
 OMODE_LEGACY,
 /* The struct mode includes some behavior for future versions
  * that can for some reason not yet be used in the normal mode
  * e.g. because it may break interfaces in some way.
  * New applications should test against this mode and developer
  * of software interacting with Icecast on an API level should
  * have a look for strict mode behavior to avoid random breakage
  * with newer versions of Icecast.
  */
 OMODE_STRICT
} operation_mode;

75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
/* ---[ connection.[ch] ]--- */

typedef struct connection_tag connection_t;

typedef enum {
    /* no TLS is used at all */
    ICECAST_TLSMODE_DISABLED = 0,
    /* TLS mode is to be detected */
    ICECAST_TLSMODE_AUTO,
    /* Like ICECAST_TLSMODE_AUTO but enforces TLS */
    ICECAST_TLSMODE_AUTO_NO_PLAIN,
    /* TLS via HTTP Upgrade:-header [RFC2817] */
    ICECAST_TLSMODE_RFC2817,
    /* TLS for transport layer like HTTPS [RFC2818] does */
    ICECAST_TLSMODE_RFC2818
} tlsmode_t;

/* ---[ slave.[ch] ]--- */

94
typedef struct relay_tag relay_t;
95

96 97 98 99
/* ---[ buffer.[ch] ]--- */

typedef struct buffer_tag buffer_t;

100 101 102 103 104 105
/* ---[ module.[ch] ]--- */

typedef struct module_tag module_t;

typedef struct module_container_tag module_container_t;

106 107 108 109
/* ---[ reportxml.[ch] ]--- */

typedef struct reportxml_tag reportxml_t;
typedef struct reportxml_node_tag reportxml_node_t;
110
typedef struct reportxml_database_tag reportxml_database_t;
111

112 113 114 115 116
/* ---[ listensocket.[ch] ]--- */

typedef struct listensocket_container_tag listensocket_container_t;
typedef struct listensocket_tag listensocket_t;

117 118 119 120 121 122 123
/* ---[ refobject.[ch] ]--- */

typedef struct refobject_base_tag refobject_base_t;

#ifdef HAVE_TYPE_ATTRIBUTE_TRANSPARENT_UNION
typedef union __attribute__ ((__transparent_union__)) {
    refobject_base_t *refobject_base;
124
    buffer_t *buffer;
125 126
    module_t *module;
    module_container_t *module_container;
127 128
    reportxml_t *reportxml;
    reportxml_node_t *reportxml_node;
129
    reportxml_database_t *reportxml_database;
130 131
    listensocket_container_t *listensocket_container;
    listensocket_t *listensocket;
132 133 134 135 136
} refobject_t;
#else
typedef void * refobject_t;
#endif

137
#endif