admin.h 1.71 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 19
#include <libxml/parser.h>
#include <libxml/tree.h>

20 21 22 23 24 25 26 27
/* formats */
typedef enum {
    ADMIN_FORMAT_AUTO,
    ADMIN_FORMAT_RAW,
    ADMIN_FORMAT_TRANSFORMED,
    ADMIN_FORMAT_PLAINTEXT
} admin_format_t;

28 29
#include "refbuf.h"
#include "client.h"
30
#include "source.h"
31
#include "auth.h"
32

Philipp Schafft's avatar
Philipp Schafft committed
33 34 35 36 37 38
/* types */
#define ADMINTYPE_ERROR   (-1)
#define ADMINTYPE_GENERAL   1
#define ADMINTYPE_MOUNT     2
#define ADMINTYPE_HYBRID    (ADMINTYPE_GENERAL|ADMINTYPE_MOUNT)

39
/* special commands */
Marvin Scholz's avatar
Marvin Scholz committed
40 41
#define ADMIN_COMMAND_ERROR (-1)
#define ADMIN_COMMAND_ANY   0 /* for ACL framework */
42

43
void admin_handle_request(client_t *client, const char *uri);
44

45 46 47 48
void admin_send_response(xmlDocPtr       doc,
                         client_t       *client,
                         admin_format_t  response,
                         const char     *xslt_template);
Marvin Scholz's avatar
Marvin Scholz committed
49

50 51 52
void admin_add_listeners_to_mount(source_t       *source,
                                  xmlNodePtr      parent,
                                  operation_mode  mode);
Marvin Scholz's avatar
Marvin Scholz committed
53

54
xmlNodePtr admin_add_role_to_authentication(auth_t *auth, xmlNodePtr parent);
55

56
int admin_get_command(const char *command);
Philipp Schafft's avatar
Philipp Schafft committed
57
int admin_get_command_type(int command);
58

59
#endif  /* __ADMIN_H__ */