icecasttypes.h 2.54 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 35 36 37 38 39 40 41 42 43 44 45 46
#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,
    ADMIN_FORMAT_TRANSFORMED,
    ADMIN_FORMAT_PLAINTEXT
} admin_format_t;

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

typedef struct acl_tag acl_t;

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

typedef struct auth_tag auth_t;

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

typedef struct ice_config_tag ice_config_t;
50

51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
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;

74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
/* ---[ 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] ]--- */

typedef struct _relay_server relay_server;

95 96 97 98 99 100 101 102 103 104 105 106
/* ---[ 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;
} refobject_t;
#else
typedef void * refobject_t;
#endif

107
#endif