admin.h 1.87 KB
Newer Older
1 2 3 4 5
/* Icecast
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
6
 * Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
7 8 9 10
 *                      Michael Smith <msmith@xiph.org>,
 *                      oddsock <oddsock@xiph.org>,
 *                      Karl Heyes <karl@xiph.org>
 *                      and others (see AUTHORS for details).
11
 * Copyright 2011-2018, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
12 13
 */

14 15 16
#ifndef __ADMIN_H__
#define __ADMIN_H__

17 18
#include <libxml/parser.h>
#include <libxml/tree.h>
19 20 21 22
#include <stdint.h>

/* Command IDs */
typedef int32_t admin_command_id_t;
23

24 25 26 27 28 29 30 31
/* formats */
typedef enum {
    ADMIN_FORMAT_AUTO,
    ADMIN_FORMAT_RAW,
    ADMIN_FORMAT_TRANSFORMED,
    ADMIN_FORMAT_PLAINTEXT
} admin_format_t;

32
#include "compat.h"
33 34
#include "refbuf.h"
#include "client.h"
35
#include "source.h"
36
#include "auth.h"
37

Philipp Schafft's avatar
Philipp Schafft committed
38 39 40 41 42 43
/* types */
#define ADMINTYPE_ERROR   (-1)
#define ADMINTYPE_GENERAL   1
#define ADMINTYPE_MOUNT     2
#define ADMINTYPE_HYBRID    (ADMINTYPE_GENERAL|ADMINTYPE_MOUNT)

44
/* special commands */
45 46
#define ADMIN_COMMAND_ERROR ((admin_command_id_t)(-1))
#define ADMIN_COMMAND_ANY   ((admin_command_id_t)0) /* for ACL framework */
47

48
void admin_handle_request(client_t *client, const char *uri);
49

50 51 52 53
void admin_send_response(xmlDocPtr       doc,
                         client_t       *client,
                         admin_format_t  response,
                         const char     *xslt_template);
Marvin Scholz's avatar
Marvin Scholz committed
54

55 56 57
void admin_add_listeners_to_mount(source_t       *source,
                                  xmlNodePtr      parent,
                                  operation_mode  mode);
Marvin Scholz's avatar
Marvin Scholz committed
58

59
xmlNodePtr admin_add_role_to_authentication(auth_t *auth, xmlNodePtr parent);
60

61 62
admin_command_id_t admin_get_command(const char *command);
int admin_get_command_type(admin_command_id_t command);
63

64
#endif  /* __ADMIN_H__ */