2004-01-28 20:02:12 -05:00
|
|
|
/* Icecast
|
|
|
|
*
|
|
|
|
* This program is distributed under the GNU General Public License, version 2.
|
|
|
|
* A copy of this license is included with this source.
|
|
|
|
*
|
|
|
|
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
|
|
|
|
* Michael Smith <msmith@xiph.org>,
|
|
|
|
* oddsock <oddsock@xiph.org>,
|
|
|
|
* Karl Heyes <karl@xiph.org>
|
|
|
|
* and others (see AUTHORS for details).
|
|
|
|
*/
|
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
#ifndef __SOURCE_H__
|
|
|
|
#define __SOURCE_H__
|
|
|
|
|
2003-07-20 21:58:54 -04:00
|
|
|
#include "cfgfile.h"
|
2003-02-02 09:33:17 -05:00
|
|
|
#include "yp.h"
|
2003-02-26 18:52:23 -05:00
|
|
|
#include "util.h"
|
2002-12-30 02:55:56 -05:00
|
|
|
#include "format.h"
|
|
|
|
|
2003-03-02 05:13:59 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2004-01-14 20:01:09 -05:00
|
|
|
struct auth_tag;
|
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
typedef struct source_tag
|
|
|
|
{
|
2002-08-16 10:26:48 -04:00
|
|
|
client_t *client;
|
2003-03-14 21:10:19 -05:00
|
|
|
connection_t *con;
|
|
|
|
http_parser_t *parser;
|
|
|
|
|
|
|
|
char *mount;
|
2002-12-30 10:19:46 -05:00
|
|
|
|
|
|
|
/* If this source drops, try to move all clients to this fallback */
|
|
|
|
char *fallback_mount;
|
|
|
|
|
2003-02-06 08:10:48 -05:00
|
|
|
/* set to zero to request the source to shutdown without causing a global
|
|
|
|
* shutdown */
|
|
|
|
int running;
|
|
|
|
|
2003-03-14 21:10:19 -05:00
|
|
|
struct _format_plugin_tag *format;
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2003-03-14 21:10:19 -05:00
|
|
|
avl_tree *client_tree;
|
|
|
|
avl_tree *pending_tree;
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2003-03-14 21:10:19 -05:00
|
|
|
rwlock_t *shutdown_rwlock;
|
|
|
|
ypdata_t *ypdata[MAX_YP_DIRECTORIES];
|
2003-02-26 18:52:23 -05:00
|
|
|
util_dict *audio_info;
|
2003-03-02 05:13:59 -05:00
|
|
|
|
|
|
|
char *dumpfilename; /* Name of a file to dump incoming stream to */
|
|
|
|
FILE *dumpfile;
|
|
|
|
|
2003-03-14 21:10:19 -05:00
|
|
|
int num_yp_directories;
|
|
|
|
long listeners;
|
2003-02-11 09:23:34 -05:00
|
|
|
long max_listeners;
|
2003-06-26 09:32:04 -04:00
|
|
|
int yp_public;
|
2003-02-17 08:01:37 -05:00
|
|
|
int send_return;
|
2004-01-14 20:01:09 -05:00
|
|
|
struct auth_tag *authenticator;
|
|
|
|
int fallback_override;
|
|
|
|
int no_mount;
|
2001-09-09 22:21:46 -04:00
|
|
|
} source_t;
|
|
|
|
|
2003-03-02 05:13:59 -05:00
|
|
|
source_t *source_create(client_t *client, connection_t *con,
|
|
|
|
http_parser_t *parser, const char *mount, format_type_t type,
|
|
|
|
mount_proxy *mountinfo);
|
2001-09-09 22:21:46 -04:00
|
|
|
source_t *source_find_mount(const char *mount);
|
2004-01-14 20:01:09 -05:00
|
|
|
source_t *source_find_mount_raw(const char *mount);
|
2003-03-30 08:52:27 -05:00
|
|
|
client_t *source_find_client(source_t *source, int id);
|
2001-09-09 22:21:46 -04:00
|
|
|
int source_compare_sources(void *arg, void *a, void *b);
|
|
|
|
int source_free_source(void *key);
|
2004-01-29 11:46:54 -05:00
|
|
|
void source_move_clients (source_t *source, source_t *dest);
|
2003-03-14 02:59:58 -05:00
|
|
|
int source_remove_client(void *key);
|
2001-09-09 22:21:46 -04:00
|
|
|
void *source_main(void *arg);
|
|
|
|
|
2004-01-29 11:46:54 -05:00
|
|
|
extern mutex_t move_clients_mutex;
|
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|