admin.h 1.65 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
#include "refbuf.h"
#include "client.h"
22
#include "source.h"
23
#include "auth.h"
24

Philipp Schafft's avatar
Philipp Schafft committed
25
26
27
28
29
30
31
/* types */
#define ADMINTYPE_ERROR   (-1)
#define ADMINTYPE_GENERAL   1
#define ADMINTYPE_MOUNT     2
#define ADMINTYPE_HYBRID    (ADMINTYPE_GENERAL|ADMINTYPE_MOUNT)

/* formats */
32
33
34
#define RAW                 1
#define TRANSFORMED         2
#define PLAINTEXT           3
35

36
/* special commands */
Marvin Scholz's avatar
Marvin Scholz committed
37
38
#define ADMIN_COMMAND_ERROR (-1)
#define ADMIN_COMMAND_ANY   0 /* for ACL framework */
39

40
void admin_handle_request(client_t *client, const char *uri);
41

42
void admin_send_response(xmlDocPtr    doc,
43
                         client_t    *client,
44
45
                         int          response,
                         const char  *xslt_template);
Marvin Scholz's avatar
Marvin Scholz committed
46

47
48
49
void admin_add_listeners_to_mount(source_t       *source,
                                  xmlNodePtr      parent,
                                  operation_mode  mode);
Marvin Scholz's avatar
Marvin Scholz committed
50

51
xmlNodePtr admin_add_role_to_authentication(auth_t *auth, xmlNodePtr parent);
52

53
int admin_get_command(const char *command);
Philipp Schafft's avatar
Philipp Schafft committed
54
int admin_get_command_type(int command);
55

56
#endif  /* __ADMIN_H__ */