2018-04-18 01:43:46 -04:00
|
|
|
/* Icecast
|
|
|
|
*
|
|
|
|
* This program is distributed under the GNU General Public License, version 2.
|
|
|
|
* A copy of this license is included with this source.
|
|
|
|
*
|
2020-10-03 04:44:37 -04:00
|
|
|
* Copyright 2018-2020, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
|
2018-04-18 01:43:46 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LISTENSOCKET_H__
|
|
|
|
#define __LISTENSOCKET_H__
|
|
|
|
|
|
|
|
#include "icecasttypes.h"
|
2018-10-10 07:15:39 -04:00
|
|
|
#include "refobject.h"
|
2018-04-18 01:43:46 -04:00
|
|
|
#include "cfgfile.h"
|
|
|
|
|
2018-10-10 07:15:39 -04:00
|
|
|
REFOBJECT_FORWARD_TYPE(listensocket_container_t);
|
|
|
|
|
2018-04-18 01:43:46 -04:00
|
|
|
listensocket_container_t * listensocket_container_new(void);
|
|
|
|
int listensocket_container_configure(listensocket_container_t *self, const ice_config_t *config);
|
2018-05-10 04:33:19 -04:00
|
|
|
int listensocket_container_configure_and_setup(listensocket_container_t *self, const ice_config_t *config);
|
2018-04-18 01:43:46 -04:00
|
|
|
int listensocket_container_setup(listensocket_container_t *self);
|
|
|
|
connection_t * listensocket_container_accept(listensocket_container_t *self, int timeout);
|
2018-05-09 05:58:09 -04:00
|
|
|
int listensocket_container_set_sockcount_cb(listensocket_container_t *self, void (*cb)(size_t count, void *userdata), void *userdata);
|
|
|
|
ssize_t listensocket_container_sockcount(listensocket_container_t *self);
|
2020-04-22 15:35:35 -04:00
|
|
|
listensocket_t * listensocket_container_get_by_id(listensocket_container_t *self, const char *id);
|
2018-04-18 01:43:46 -04:00
|
|
|
|
2018-10-10 07:15:39 -04:00
|
|
|
REFOBJECT_FORWARD_TYPE(listensocket_t);
|
|
|
|
|
2018-04-18 01:43:46 -04:00
|
|
|
int listensocket_refsock(listensocket_t *self);
|
|
|
|
int listensocket_unrefsock(listensocket_t *self);
|
2018-05-18 09:58:51 -04:00
|
|
|
connection_t * listensocket_accept(listensocket_t *self, listensocket_container_t *container);
|
2018-04-18 01:43:46 -04:00
|
|
|
const listener_t * listensocket_get_listener(listensocket_t *self);
|
2018-05-11 04:08:38 -04:00
|
|
|
int listensocket_release_listener(listensocket_t *self);
|
2018-05-18 09:49:15 -04:00
|
|
|
listener_type_t listensocket_get_type(listensocket_t *self);
|
2018-04-18 01:43:46 -04:00
|
|
|
|
2022-03-05 15:34:55 -05:00
|
|
|
const char * listensocket_type_to_string(listener_type_t type);
|
|
|
|
const char * listensocket_tlsmode_to_string(tlsmode_t mode);
|
|
|
|
|
2018-04-18 01:43:46 -04:00
|
|
|
#endif
|