para_server's aac audio format handler.
More...
#include <regex.h>
#include <neaacdec.h>
#include "para.h"
#include "mp4.h"
#include "error.h"
#include "portable_io.h"
#include "afh.h"
#include "string.h"
#include "fd.h"
para_server's aac audio format handler.
◆ aac_afh
Initial value:= {
.get_file_info = aac_get_file_info,
.suffixes = aac_suffixes,
.rewrite_tags = aac_afh_rewrite_tags,
.open = aac_afh_open,
.get_chunk = aac_afh_get_chunk,
.close = aac_afh_close,
}
The audio format handler for the Advanced Audio Codec.
This is only compiled in if the faad library is installed.
#define RINGBUFFER_SIZE
How many lines of output to remember.
Definition: gui.c:46
int fd_flags
The descriptor flags of STDOUT at startup.
Definition: stdout.h:16
bool row_belongs_to_score_table(const struct osl_row *aft_row)
Find out whether an audio file is contained in the score table.
Definition: score.c:266
int score_get_best(struct osl_row **aft_row, long *score)
Get the admissible audio file with highest score.
Definition: score.c:223
#define para_isspace(c)
Wrapper for isspace.
Definition: para.h:173
void(* close)(struct mixer_handle **handle)
Free all resources associated with the given handle.
Definition: mix.h:35
void print_filter_list(void)
Print a short summary of all available filters to stdout.
Definition: filter_common.c:158
#define MAX_STAT_CLIENTS
The maximal number of simultaneous connections.
Definition: audiod_command.c:36
#define OPT_GIVEN(_name)
Definition: gui.c:33
void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, const void *bits, const void *codes, int codes_size)
Build VLC decoding tables suitable for use with get_vlc().
Definition: bitstream.c:140
void daemon_set_logfile(const char *logfile_name)
Init or change the name of the log file.
Definition: daemon.c:129
struct afh_info afhi
Vss needs this for streaming.
Definition: afh.h:62
int dispatch_local_connection(int accept_fd)
Handle arriving connections on the local socket.
Definition: audiod_command.c:388
void afh_get_header(struct afh_info *afhi, uint8_t audio_format_id, void *map, size_t mapsize, char **buf, size_t *len)
Get the header of an audio file.
Definition: afh_common.c:349
void mp_shutdown(struct mp_context *ctx)
Deallocate the resources of a mood parser.
Definition: mp.c:586
#define BTRN_MAX_PENDING
640K ought to be enough for everybody ;)
Definition: buffer_tree.c:1220
unsigned filter_num
The number in the array of available filters.
Definition: filter.h:10
@ CL_SENT_AUTH
Client sends the authentication request.
Definition: client.h:12
#define OPT_UINT32_VAL(_name, _lpr)
Definition: recv.c:29
void generic_com_deny(struct sender_command_data *scd, struct sender_status *ss)
Deny connections from the given range of IP addresses.
Definition: send_common.c:265
@ COLOR_STATUSBAR
Definition: gui.c:74
int sched_request_barrier(struct timeval *barrier, struct sched *s)
Bound the I/O timeout by an absolute time in the future.
Definition: sched.c:409
void btr_remove_node(struct btr_node **btrnp)
Remove a node from a buffer tree.
Definition: buffer_tree.c:817
@ EXEC_IDLE
No process running.
Definition: gui.c:62
void client_close(struct client_task *ct)
Close the connection to para_server and free all resources.
Definition: client_common.c:39
struct check_wav_context * check_wav_init(struct btr_node *parent, struct btr_node *child, struct wav_params *params, struct btr_node **cw_btrn)
Allocate and set up a new check_wav instance.
Definition: check_wav.c:206
#define FILTER_CMD_OPT_RESULT(_cmd, _opt, _lpr)
Definition: filter.h:106
void acl_add_entry(struct list_head *acl, char *addr, int netmask)
Add an entry to an access control list.
Definition: acl.c:82
int para_atoi32(const char *str, int32_t *value)
Convert a string to a 32-bit signed integer value.
Definition: string.c:604
void mp_shutdown(struct mp_context *ctx)
Deallocate the resources of a mood parser.
Definition: mp.c:586
struct task * task
The associated task structure.
Definition: signal.h:12
int pass_buffer_as_shm(int fd, uint8_t band, const char *buf, size_t size)
Send data as shared memory to a file descriptor.
Definition: afs.c:688
@ AFTCOL_AFSI
The audio file selector info.
Definition: upgrade_db.c:120
int create_argv(const char *buf, const char *delim, char ***result)
Split a buffer into words.
Definition: string.c:800
@ NUM_SENDER_CMDS
Used as array size in struct sender.
Definition: send.h:28
char ** listen_addresses
Derived from –http-listen-address and –dccp-listen-address.
Definition: send.h:173
const struct writer lsg_write_cmd_com_oss_user_data
Definition: oss_write.c:247
int cq_enqueue(struct chunk_queue *cq, const char *buf, size_t num_bytes)
Add a chunk to the given queue.
Definition: chunk_queue.c:49
int top_lines_min
Minimal admissible number of lines to display the top window.
Definition: gui.h:38
#define OPT_STRING_VAL(_name)
Definition: play.c:39
int task_reap(struct task **tptr)
Obtain the error status of a task and deallocate its resources.
Definition: sched.c:169
uint32_t afs_socket_cookie
A random number used to "authenticate" the afs connection.
Definition: server.c:74
@ ATS_TRACK_CHANGE
A trak atom was seen after the mp4a atom.
Definition: mp4.c:35
const struct afs_table_operations score_ops
The score table stores (aft row, score) pairs in memory.
Definition: score.c:326
int decoder_execute(const char *cmd, unsigned sample_rate, unsigned channels, char **result)
Execute a btr command for a decoder.
Definition: filter_common.c:209
#define HTTP_OK_MSG
sent by the http sender to the client
Definition: http.h:4
Used for client-server communication encryption.
Definition: crypt.h:109
void close_stat_clients(void)
Empty the status clients list.
Definition: audiod_command.c:128
const uint32_t * huffcodes
VLC bit values.
Definition: wmadata.h:29
void generic_filter_pre_monitor(struct sched *s, void *context)
Request a minimal timeout if not idle.
Definition: filter_common.c:181
const uint8_t * huffbits
VLC bit size.
Definition: wmadata.h:31
#define DCCP_SOCKOPT_AVAILABLE_CCIDS
List of supported CCIDs.
Definition: net.c:840
#define OPT_GIVEN(_name, _lpr)
Definition: recv.c:28
Exported symbols of the audio file selector.
int daemonize(bool parent_waits)
Do the usual stuff to become a daemon.
Definition: daemon.c:227
void generic_com_on(struct sender_status *ss, unsigned protocol)
Activate a paraslash sender.
Definition: send_common.c:282
int schedule(struct sched *s)
The core function of all paraslash programs.
Definition: sched.c:126
exported symbols from sideband.c
const struct filter lsg_filter_cmd_com_sync_user_data
Definition: sync_filter.c:377
int shm_destroy(int id)
Destroy the given shared memory area.
Definition: ipc.c:132
#define RECEIVER_CMD(_a)
Definition: audiod.c:95
__malloc struct oac_custom_header * oac_custom_header_new(void)
Allocate and return a custom header structure.
Definition: ogg_afh_common.c:368
struct writer lsg_write_cmd_com_alsa_user_data
Definition: alsa_write.c:350
#define UNROLL
How often the loop is unrolled.
Definition: fec.c:174
void(* pre_monitor)(struct sched *s, void *context)
Ask the scheduler to check whether data can be written.
Definition: write.h:37
void daemon_set_log_color_or_die(const char *arg)
Set the color for log messages of the given severity level.
Definition: daemon.c:65
@ CWS_NO_HEADER
First part of the stream did not look like a wav header.
Definition: check_wav.c:26
uint32_t lyrics_id
Lyrics blob associated with this file (foreign key).
Definition: afs.h:16
char ** i9e_complete_commands(const char *word, struct i9e_completer *completers)
Return the list of partially matching words.
Definition: interactive.c:670
const struct filter lsg_filter_cmd_com_wmadec_user_data
Definition: wmadec_filter.c:1228
@ PM_REVERSE_LOOP
Loop in reverse order.
Definition: afs.h:121
void apc_free_pubkey(struct asymmetric_key *key)
Deallocate a public key.
Definition: gcrypt.c:473
#define RSA_PRIVKEY_SEXP
S-expression for a private RSA key.
Definition: gcrypt.c:111
int xwrite(int fd, const char *buf, size_t len)
Write a buffer to a file descriptor, re-writing on short writes.
Definition: fd.c:123
int mp4_get_sample_size(const struct mp4 *f, uint32_t sample, uint32_t *result)
Look up and return the size of the given sample in the stsz table.
Definition: mp4.c:772
const struct receiver lsg_recv_cmd_com_dccp_user_data
Definition: dccp_recv.c:161
#define CMD_PTR
Definition: audiod.c:42
void i9e_print_status_bar(char *buf, unsigned len)
Print the current status to stderr.
Definition: interactive.c:551
void acl_allow(char *addr, int netmask, struct list_head *acl, int default_deny)
Permit access for a range of IP addresses.
Definition: acl.c:170
void para_sigaction(int sig, void(*handler)(int))
Install the given handler for the given signal.
Definition: signal.c:129
uint64_t last_played
Seconds since the epoch.
Definition: afs.h:8
Task for signal handling.
Definition: signal.h:8
Filter-related structures and exported symbols from filter_common.c.
void task_notify(struct task *t, int err)
Set the notification value of a task.
Definition: sched.c:291
int para_accept(int fd, void *addr, socklen_t size, int *new_fd)
Wrapper around the accept system call.
Definition: net.c:822
#define MIN_CONSEC_GOOD_FRAMES
Definition: mp3_afh.c:27
struct sb_context * sbc[2]
The sideband contexts for receiving/sending.
Definition: client.h:32
struct btr_pool * btr_pool_new(const char *name, size_t area_size)
Create a new buffer pool.
Definition: buffer_tree.c:70
void btr_pool_free(struct btr_pool *btrp)
Deallocate resources used by a buffer pool.
Definition: buffer_tree.c:89
uint32_t * chunk_table
The table that specifies the offset of the individual pieces in the current audio file.
Definition: afh.h:38
@ ATTRIBUTE_ADD
An attribute was added.
Definition: afs.h:33
__a_const int wma_log2(unsigned int v)
Compute the base-2 logarithm.
Definition: wma_common.c:166
int mood_loop(struct mood_instance *m, osl_rbtree_loop_func *func, void *data)
Iterate over the admissible files of a mood instance.
Definition: mood.c:689
@ AFSI_ATTRIBUTES_OFFSET
Storage position of the attributes bitmap.
Definition: aft.c:134
void generic_com_deny(struct sender_command_data *scd, struct sender_status *ss)
Deny connections from the given range of IP addresses.
Definition: send_common.c:265
void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, const void *bits, const void *codes, int codes_size)
Build VLC decoding tables suitable for use with get_vlc().
Definition: bitstream.c:140
#define NUM_AFS_TABLES
Used to loop over the afs tables.
Definition: afs.c:56
Symbols exported from audiod.c.
int line_handler_t(char *, void *)
Used for for_each_line().
Definition: string.h:46
#define FOR_EACH_BUFFER_REF_SAFE(_br, _tmp, _btrn)
Definition: buffer_tree.c:249
bool mp_eval_row(const struct osl_row *aft_row, struct mp_context *ctx)
Determine whether the given audio file is admissible.
Definition: mp.c:562
int para_munmap(void *start, size_t length)
A wrapper for munmap(2).
Definition: fd.c:496
const char * author
Also printed at startup.
Definition: gui.h:30
__malloc char * para_hostname(void)
Get the own hostname.
Definition: string.c:346
Internal mood parser API (backend).
#define OPT_STRING_VAL(_name)
Definition: audiod.c:45
unsigned int vss_stopped(void)
Check if the vss is currently stopped.
Definition: vss.c:793
#define UNIX_PATH_MAX
The buffer size of the sun_path component of struct sockaddr_un.
Definition: net.c:884
void(* pre_monitor)(struct sched *s, void *context)
Configure watch fds and impose an upper bound on the I/O timeout.
Definition: sched.h:56
#define FLACDEC_MAX_OUTPUT_SIZE
Definition: flacdec_filter.c:201
int apc_pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf, unsigned len, unsigned char **outbuf)
Encrypt a buffer using asymmetric keys.
Definition: gcrypt.c:562
union mp_semantic_value sv
Leaf nodes only.
Definition: mp.h:77
int check_private_key_file(const char *file)
Check existence and permissions of a private key file.
Definition: crypt_common.c:127
int(* init_fec)(struct sender_client *sc)
Transport-layer initialisation for FEC support.
Definition: send.h:163
void id3_field_finish(union id3_field *field)
Exported symbols from ringbuffer.c.
uint8_t data_slices_per_group
Number of slices minus number of redundant slices.
Definition: server.h:25
@ NUM_BLOB_COLUMNS
A blob table has that many columns.
Definition: afs.h:318
@ AFHI_CHANGE
The afh info struct of an audio file changed.
Definition: afs.h:41
void i9e_close(void)
Reset the terminal and save the in-memory command line history.
Definition: interactive.c:224
void imdct_end(struct mdct_context *s)
Deallocate imdct resources.
Definition: imdct.c:399
#define FOR_EACH_BUDDY(_buddy, _list)
Definition: sync_filter.c:49
#define OPT_RESULT(_name)
Definition: filter.c:28
#define WAV_HEADER_LEN
Length of a standard wav header.
Definition: check_wav.c:17
unsigned num_matches
Gets increased by one for each match.
Definition: afs.h:147
void afh_free_header(char *header_buf, uint8_t audio_format_id)
Deallocate any resources obtained from afh_get_header().
Definition: afh_common.c:373
void acl_allow(char *addr, int mask, struct list_head *acl, int default_deny)
Permit access for a range of IP addresses.
Definition: acl.c:170
size_t btr_next_buffer(const struct btr_node *btrn, char **bufp)
Obtain the next buffer of the input queue of a buffer tree node.
Definition: buffer_tree.c:717
struct list_head * prev
Pointer to the previous list entry.
Definition: list.h:21
int xpoll(struct pollfd *fds, nfds_t nfds, int timeout)
Simple wrapper for poll(2).
Definition: fd.c:519
int aft_check_callback(struct afs_callback_arg *aca)
Check the audio file table for inconsistencies.
Definition: aft.c:2527
void * conf
A pointer to the configuration of this instance.
Definition: filter.h:19
int shm_detach(void *addr)
Detach a shared memory segment.
Definition: ipc.c:189
int para_next_signal(void)
Return the number of the next pending signal.
Definition: signal.c:212
@ COLOR_ERRMSG
Definition: gui.c:78
global paraslash definitions
void para_unblock_signal(int sig)
Unblock a signal.
Definition: signal.c:195
int callback_result_handler(struct osl_object *result, uint8_t band, void *private)
Dispatch the output of an afs callback.
Definition: afs.h:192
void btr_log_tree(const struct btr_node *btrn, int ll)
Write the current buffer (sub-)tree to the log.
Definition: buffer_tree.c:1188
void * private_data
Passed to max_size_handler().
Definition: string.h:30
#define OPT_STRING_VAL(_name, _lpr)
Definition: upgrade_db.c:22
const struct user * user_list_lookup(const char *name)
Lookup a user in the user list.
Definition: user_list.c:152
int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
Exec the given command.
Definition: exec.c:130
#define PRIVATE_OPENSSH_KEY_FOOTER
Private OPENSSH keys (RFC4716) end with this footer.
Definition: crypt_common.c:265
void freep(void *arg)
Free the content of a pointer and set it to NULL.
Definition: string.c:258
int moods_event_handler(enum afs_events event, __a_unused struct para_buffer *pb, void *data)
Notification callback for the moods table.
Definition: mood.c:739
__must_check __malloc char * para_strdup(const char *s)
Paraslash's version of strdup().
Definition: string.c:154
void daemon_set_priority(int prio)
Renice the calling process.
Definition: daemon.c:328
int decode_private_key(const char *key_file, unsigned char **result, size_t *blob_size)
Decode an openssh-v1 (aka RFC4716) or PEM (aka ASN.1) private key.
Definition: crypt_common.c:280
void audiod_status_dump(bool force)
Send the current audiod status to all connected stat clients.
Definition: audiod_command.c:447
Describes a data sink for audio streams.
Definition: write.h:35
int playlists_event_handler(enum afs_events event, __a_unused struct para_buffer *pb, void *data)
Handle afs events relevant to playlists.
Definition: playlist.c:263
void btr_get_node_start(const struct btr_node *btrn, struct timeval *tv)
Get the time of the first I/O for a buffer tree node.
Definition: buffer_tree.c:1273
void * context
This pointer is saved when the task is registered.
Definition: sched.h:73
int loglevel
Threshold for i9e_log().
Definition: interactive.h:55
#define BITS
Always write 16 bit header.
Definition: wav_filter.c:19
check_wav_state
The possible states of a check_wav instance.
Definition: check_wav.c:20
void print_filter_helps(bool detailed)
Print help text of each filter to stdout.
Definition: filter_common.c:121
int apc_get_pubkey(const char *key_file, struct asymmetric_key **result)
Read an asymmetric key from a file.
Definition: openssl.c:334
void del_close_on_fork_list(int fd)
Delete one file descriptor from the close-on-fork list.
Definition: close_on_fork.c:51
#define CLIENT_BUFSIZE
The size of the receiving buffer.
Definition: client_common.c:30
void daemon_set_loglevel(int loglevel)
Control the verbosity for logging.
Definition: daemon.c:150
score_table_columns
The score table consists of two columns: The aft_row column contains pointers to the rows of the audi...
Definition: score.c:46
struct stream_cipher * sc_new(const unsigned char *data, int len)
Allocate and initialize an aes_ctr128 stream cipher structure.
Definition: gcrypt.c:631
#define NUM_MAPPED_KEYS
Definition: play.c:532
int parse_fec_url(const char *arg, struct sender_command_data *scd)
Parse a FEC URL string.
Definition: send_common.c:491
void generic_acl_deplete(struct list_head *acl)
Empty the access control list of a sender.
Definition: send_common.c:248
@ SENDER_on
Activate the sender.
Definition: send.h:27
int(* set)(struct mixer_handle *handle, int val)
Change the value of the selected channel.
Definition: mix.h:33
int para_atoi64(const char *str, int64_t *value)
llong_minmax
Definition: string.c:567
#define FOR_EACH_STATUS_ITEM(i)
Loop over each status item.
Definition: para.h:277
ssize_t send_cred_buffer(int, char *)
Send a buffer and the credentials of the current process to a socket.
Definition: net.c:1030
#define RECV_CMD_OPT_GIVEN(_recv, _opt, _lpr)
Definition: recv.h:85
void(* open)(struct filter_node *fn)
Open one instance of this filter.
Definition: filter.h:53
__must_check int afs_event(enum afs_events event, struct para_buffer *pb, void *data)
The afs event dispatcher.
Definition: afs.c:1133
__must_check __malloc char * para_homedir(void)
Get the home directory of the calling user.
Definition: string.c:319
char * server_get_tasks(void)
Return the list of tasks for the server process.
Definition: server.c:129
void free_lpr(void)
Deallocate all lopsub parse results.
Definition: server.c:644
int skip_cells(const char *s, size_t cells_to_skip, size_t *bytes_to_skip)
Skip a given number of cells at the beginning of a string.
Definition: string.c:956
char * prompt
Text of the current prompt.
Definition: interactive.h:65
void crypt_init(void)
Initialize the crypto backend.
Definition: gcrypt.c:75
@ BLOB_REMOVE
A blob is about to be removed.
Definition: afs.h:53
@ CL_RECEIVED_PROCEED
Server accepts this authentication.
Definition: client.h:18
int guess_audio_format(const char *name)
Guess the audio format judging from filename.
Definition: afh_common.c:103
int apc_pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf, unsigned len, unsigned char **outbuf)
Encrypt a buffer using asymmetric keys.
Definition: gcrypt.c:562
int table_allocated
Amount of memory allocated so far.
Definition: bitstream.h:30
#define TAG_LEN(_len)
Total length of an on-disk metadata tag.
Definition: mp4.c:874
@ GM_SLOPPY
Ignore the data and do not write.
Definition: grab_client.c:26
uint32_t image_id
Image blob associated with this file (foreign key).
Definition: afs.h:14
int mood_load(const char *mood_name, struct mood_instance **result, char **msg)
Populate a score table with admissible files for the given mood.
Definition: mood.c:623
@ EXEC_XCMD
External process running.
Definition: gui.c:64
#define FOR_EACH_FECDEC_GROUP(g, d)
Iterate over all fecdec groups.
Definition: fecdec_filter.c:83
int send_queued_chunks(int fd, struct chunk_queue *cq)
Try to empty the chunk queue for this fd.
Definition: send_common.c:83
void vss_del_fec_client(struct fec_client *fc)
Remove one entry from the list of active fec clients.
Definition: vss.c:687
_static_inline_ int osl(int ret)
Wrapper for osl library calls.
Definition: error.h:320
int fds[3]
File descriptors to use for input/output/log.
Definition: interactive.h:63
@ DF_COLOR_LOG
Use colored output.
Definition: daemon.h:34
__malloc char * para_hostname(void)
Get the own hostname.
Definition: string.c:346
int get_btr_sample_rate(struct btr_node *btrn, int32_t *result)
Ask parent btr nodes for the sample rate of the current stream.
Definition: write_common.c:205
struct task * task
The task structure used by the scheduler.
Definition: stdout.h:12
int afs_cb_result_handler(struct osl_object *result, uint8_t band, void *private)
Result handler for sending data to the para_client process.
Definition: afs.c:490
void ms2tv(long unsigned n, struct timeval *tv)
Convert milliseconds to a struct timeval.
Definition: time.c:24
struct btr_node * child
Child of the new node.
Definition: buffer_tree.h:160
#define DEFINE_STDERR_LOGGER(funcname, loglevel_barrier)
Define a standard log function that always writes to stderr.
Definition: para.h:59
void i9e_ll_completer(struct i9e_completion_info *ci, struct i9e_completion_result *cr)
Complete on severity strings.
Definition: interactive.c:809
#define CMD_PTR
Definition: play.c:34
@ SCORECOL_SCORE
The score.
Definition: score.c:50
void playlist_unload(struct playlist_instance *pi)
Free all resources of the given/current playlist.
Definition: playlist.c:117
int playlist_load(const char *name, struct playlist_instance **result, char **msg)
Populate the score table from the paths of a playlist database object.
Definition: playlist.c:149
int xwritev(int fd, struct iovec *iov, int iovcnt)
Write an array of buffers, handling non-fatal errors.
Definition: fd.c:64
#define CLIENT_OPT_UINT32_VAL(_name, _lpr)
Definition: client.h:54
int64_t mp_duration(struct mp_context *ctx)
Return the duration of the audio file from the afh info structure.
Definition: mp.c:402
#define VSS_NEXT
Skip remaining part of current audio file.
Definition: vss.h:17
__printf_2_3 void afs_error(const struct afs_callback_arg *aca, const char *fmt,...)
Format and send an error message to the command handler.
Definition: afs.c:739
__malloc char * generic_sender_help(void)
Get the generic help text.
Definition: send_common.c:416
#define OPT_UINT32_VAL(_name)
Definition: afh.c:25
__must_check int strwidth(const char *s, size_t *result)
Compute the width of an UTF-8 string.
Definition: string.c:1001
int compute_afhi(const char *path, char *data, size_t size, int fd, struct afh_info *afhi)
Call get_file_info() to obtain an afhi structure.
Definition: afh_common.c:160
void daemon_open_log_or_die(void)
Open the logfile in append mode.
Definition: daemon.c:289
int for_each_stat_item(char *item_buf, size_t num_bytes, int(*item_handler)(int, char *))
Call a function for each complete status item of a buffer.
Definition: stat.c:31
#define list_entry(ptr, type, member)
Get the struct in which this entry is embedded in.
Definition: list.h:125
struct btr_node * btr_new_node(struct btr_node_description *bnd)
Create a new buffer tree node.
Definition: buffer_tree.c:263
int para_atoi64(const char *str, int64_t *result)
llong_minmax
Definition: string.c:567
float fftsample_t
Definition: imdct.c:26
#define NUM_LINES(len)
Number of lines of the window are occupied by an output line.
Definition: gui.c:186
int para_listen(unsigned l4type, const char *addr, uint16_t port)
Create a passive / listening socket.
Definition: net.c:542
bool sockaddr_equal(const struct sockaddr *sa1, const struct sockaddr *sa2)
Compare the address part of IPv4/6 addresses.
Definition: net.c:738
void clear_and_dump_items(void)
Flush and send all status items.
Definition: audiod_command.c:496
#define NUM_FEC_GROUPS
How many FEC groups to store in memory.
Definition: fecdec_filter.c:25
int fec_decode(struct fec_parms *parms, unsigned char **data, int *idx, int sz)
Decode one slice from the group of received slices.
Definition: fec.c:597
data needed to authenticate the user
Definition: user_list.h:24
void mutex_unlock(int id)
Unlock a mutex.
Definition: ipc.c:94
@ AFTCOL_AFSI
The audio file selector info.
Definition: aft.c:207
__must_check __malloc char * para_logname(void)
Get the logname of the current user.
Definition: string.c:304
#define MAXLINE
used in various contexts
Definition: para.h:28
const struct afs_table_operations attr_ops
The attribute table stores name/bitnum pairs.
Definition: attribute.c:494
void stdin_task_register(struct stdin_task *sit, struct sched *s)
Register a stdin task structure.
Definition: stdin.c:88
Structure for bistream I/O.
Definition: bitstream.h:12
void free_vlc(struct vlc *vlc)
Deallocate all resources of a VLC table.
Definition: bitstream.c:159
void * mp_yyscan_t
Since we use a reentrant lexer, all functions generated by flex(1) receive an additional argument of ...
Definition: mp.h:18
@ SENDER_off
Deactivate the sender.
Definition: send.h:27
int send_lls_callback_request(afs_callback *f, const struct lls_command *const cmd, struct lls_parse_result *lpr, void *private_result_data)
Wrapper for send_callback_request() which passes a lopsub parse result.
Definition: afs.c:264
__must_check __malloc char * para_strcat(char *a, const char *b)
Paraslash's version of strcat().
Definition: string.c:282
int write_all(int fd, const char *buf, size_t len)
Write to a file descriptor, fail on short writes.
Definition: fd.c:142
int main(int argc, char *argv[])
Definition: upgrade_db.c:345
int dispatch_local_connection(int accept_fd)
Handle arriving connections on the local socket.
Definition: audiod_command.c:388
int mp4_open(const struct mp4_callback *cb, struct mp4 **result)
Read the audio track and the metadata of an mp4 file.
Definition: mp4.c:665
unsigned pfd_array_len
Number of elements in the above array, passed to poll(2).
Definition: sched.h:25
int send_strerror(struct command_context *cc, int err)
Send an error message to a client.
Definition: command.c:200
__malloc char * audiod_get_decoder_flags(void)
Return the flags for the decoder_flags status item.
Definition: audiod.c:221
int word_num
The cursor is on this word.
Definition: interactive.h:14
__noreturn void afs_init(int socket_fd)
Initialize the audio file selector process.
Definition: afs.c:926
void * data
Data pointer passed to the action function.
Definition: afs.h:145
__must_check int mark_fd_blocking(int fd)
Set a file descriptor to blocking mode.
Definition: fd.c:308
int recv_bin_buffer(int fd, char *buf, size_t size)
Receive data from a file descriptor.
Definition: net.c:770
char * pat
Unescaped C string (without quotes and flags).
Definition: mp.h:34
Data specific to a client task.
Definition: client.h:26
int task_get_notification(const struct task *t)
Return the notification value of a task.
Definition: sched.c:311
#define APC_CHALLENGE_SIZE
The size of the challenge sent to the client.
Definition: crypt.h:12
int playlist_loop(struct playlist_instance *pi, osl_rbtree_loop_func *func, void *data)
Iterate over all admissible audio files of a playlist instance.
Definition: playlist.c:209
int btr_pool_get_buffers(const struct btr_pool *btrp, struct iovec iov[2])
Get references to buffers pointing to free space of the buffer pool area.
Definition: buffer_tree.c:177
uint8_t num_children
The number of children is implicitly given by the id, but we include it here to avoid having to maint...
Definition: mp.h:84
char * name
The username.
Definition: user_list.h:28
struct mp_ast_node ** children
Pointers to the child nodes (interior nodes only).
Definition: mp.h:75
#define OPT_GIVEN(_name)
Definition: filter.c:30
struct sb_context * sb_new_send(struct sb_buffer *sbb, bool dont_free, sb_transformation t, void *trafo_context)
Prepare to write a sideband packet.
Definition: sideband.c:62
unsigned char * challenge_hash
The hash value of the decrypted challenge.
Definition: client.h:36
#define HGAINVLCBITS
Definition: wmadec_filter.c:127
int64_t mp_num_attributes_set(struct mp_context *ctx)
Count the number of attributes set.
Definition: mp.c:330
#define RECV_CMD_OPT_UINT32_VAL(_recv, _opt, _lpr)
Definition: recv.h:89
size_t offset
The next para_printf() will write at this offset.
Definition: string.h:22
char * mp_path(struct mp_context *ctx)
Return the full path to the audio file.
Definition: mp.c:285
#define EXPVLCBITS
Definition: wmadec_filter.c:126
#define RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)
Definition: recv.h:83
int oac_get_file_info(char *map, size_t numbytes, struct afh_info *afhi, struct oac_callback_info *ci)
Pass first three ogg packets to callback and build the chunk table.
Definition: ogg_afh_common.c:121
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: mixer.c:19
int readv_nonblock(int fd, struct iovec *iov, int iovcnt, size_t *num_bytes)
Read from a non-blocking file descriptor into multiple buffers.
Definition: fd.c:207
void color_parse_or_die(const char *value, char *dst)
Create an escape sequence for colored output.
Definition: color.c:52
void btr_copy(const void *src, size_t n, struct btr_pool *btrp, struct btr_node *btrn)
Copy data to write head of a buffer pool and feed it to all children nodes.
Definition: buffer_tree.c:494
void vss_del_fec_client(struct fec_client *fc)
Remove one entry from the list of active fec clients.
Definition: vss.c:687
Paraslash's scheduler.
Definition: sched.h:17
The foreground and background color of each status item, the decorations and all messages can be cust...
Definition: gui.h:9
afs_events
Events caused by changes to an afs table.
Definition: afs.h:31
#define FOR_EACH_WRITER(i)
Loop over all writers.
Definition: write_common.c:18
struct gui_color_spec color
Foreground and background color.
Definition: gui.h:21
@ AUDIO_FILE_RENAME
An audio file was renamed.
Definition: afs.h:43
@ PLAY_MODE_MOOD
Admissible files are determined by a mood definition.
Definition: afs.h:92
void version_handle_flag(const char *pfx, bool flag)
Print the version text and exit successfully.
Definition: version.c:63
int opus_parse_header(const char *packet, int len, struct opus_header *h)
Get metadata of an opus stream.
Definition: opus_common.c:84
const struct sender http_sender
The HTTP sender.
Definition: http_send.c:273
#define DECODER_SAMPLE_FORMAT
Definition: filter_common.c:192
Describes one supported sender of para_server.
Definition: send.h:46
int create_shifted_argv(const char *buf, const char *delim, char ***result)
Split a buffer into words, offset one.
Definition: string.c:819
struct task * task
The task corresponding to this filter node.
Definition: filter.h:25
exported symbols from string.c
int sb_received(struct sb_context *c, size_t nbytes, struct sb_buffer *result)
Update the sideband context after data has been received.
Definition: sideband.c:213
#define CMD_PTR
Definition: audioc.c:32
int generic_recv_pre_monitor(struct sched *s, struct receiver_node *rn)
Request a minimal timeout in case of buffer tree errors.
Definition: recv_common.c:113
__must_check int mark_fd_nonblocking(int fd)
Set a file descriptor to non-blocking mode.
Definition: fd.c:326
play_mode
How audio files are selected by afs.
Definition: afs.h:90
char sep_char
The character for the separator line.
Definition: gui.h:32
#define EXPORT_PLAY_CMD_HANDLER(_cmd)
Definition: play.c:697
int apc_priv_decrypt(const char *key_file, unsigned char **outbuf, unsigned char *inbuf, int inlen)
Decrypt a buffer using a private key.
Definition: gcrypt.c:494
@ FEC_GROUP_USABLE
Use all data in the group.
Definition: fecdec_filter.c:256
int makesock_addrinfo(unsigned l4type, bool passive, struct addrinfo *ai, struct flowopts *fo)
Create an active or passive socket.
Definition: net.c:449
void hash_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash of the given input data.
Definition: gcrypt.c:33
int fg
Foreground color.
Definition: gui.h:10
char *(* get_channels)(struct mixer_handle *handle)
Returns a string of all valid mixer channels.
Definition: mix.h:26
@ DF_LOG_TIME
Prepend log message with date and time.
Definition: daemon.h:30
void btr_splice_out_node(struct btr_node **btrnp)
Remove a node from the buffer tree, reconnecting parent and children.
Definition: buffer_tree.c:893
struct stream_cipher * sc_new(const unsigned char *data, int len)
Allocate and initialize an aes_ctr128 stream cipher structure.
Definition: gcrypt.c:631
int read_size_header(const char *buf)
Read a four-byte hex-number and return its value.
Definition: string.c:451
const char * filter_name(int filter_num)
Return the name of a filter, given its number.
Definition: filter_common.c:52
const struct audio_format_handler opus_afh
The audio format handler for ogg/opus.
Definition: opus_afh.c:300
void print_filter_list(void)
Print a short summary of all available filters to stdout.
Definition: filter_common.c:158
Contains huffcodes, huffbits and run/level tables.
Definition: wmadata.h:25
int compute_word_num(const char *buf, const char *delim, int offset)
Get the number of the word the cursor is on.
Definition: string.c:723
void apc_free_pubkey(struct asymmetric_key *key)
Deallocate a public key.
Definition: gcrypt.c:473
int schedule(struct sched *s)
The core function of all paraslash programs.
Definition: sched.c:126
#define INTERNAL_KEYMAP_ENTRIES
Definition: play.c:500
int para_mkdir(const char *path)
Create a directory, don't fail if it already exists.
Definition: fd.c:401
int tv_convex_combination(const long a, const struct timeval *tv1, const long b, const struct timeval *tv2, struct timeval *result)
Compute a convex combination of two time values.
Definition: time.c:130
unsigned y
Vertical start coordinate for this item.
Definition: gui.h:19
void vss_shutdown(void)
Turn off the virtual streaming system.
Definition: vss.c:1203
@ LS_SORT_BY_IMAGE_ID
-s=i
Definition: aft.c:60
#define FEC_EOF_PACKET_LEN
The number of bytes of the FEC_EOF_PACKET.
Definition: para.h:179
void add_close_on_fork_list(int fd)
Add one file descriptor to the close-on-fork list.
Definition: close_on_fork.c:32
size_t btr_pool_unused(const struct btr_pool *btrp)
Get the number of unused bytes in the buffer pool.
Definition: buffer_tree.c:132
int cq_get(struct queued_chunk *qc, const char **buf, size_t *num_bytes)
Get a pointer to the given queued chunk.
Definition: chunk_queue.c:117
int lsu_merge_config_file_options(const char *path, const char *dflt, struct lls_parse_result **lpr, const struct lls_command *cmd, const struct lls_suite *suite, unsigned flags)
Merge command line options and config file options.
Definition: lsu.c:170
@ SBD_WARNING_LOG
Definition: sideband.h:66
void parse_config_or_die(bool reload)
(Re-)read the server configuration files.
Definition: server.c:195
size_t btr_next_buffer_omit(const struct btr_node *btrn, size_t omit, char **bufp)
Obtain the next buffer of the input queue, omitting data.
Definition: buffer_tree.c:651
void deplete_close_on_fork_list(void)
Remove all listed fds from the close on fork list.
Definition: close_on_fork.c:98
@ BLOBCOL_DEF
The actual blob contents.
Definition: afs.h:316
#define LEFT
Status item text should be left-aligned.
Definition: gui.h:64
uint32_t max_chunk_size
Size of the largest chunk, introduced in v0.6.0.
Definition: afh.h:40
@ TOUCH_FLAG_FNM_PATHNAME
Whether the FNM_PATHNAME flag should be passed to fnmatch().
Definition: aft.c:2043
#define OPT_GIVEN(_name, _lpr)
Definition: write.c:29
unsigned int perms
The privileges of this user.
Definition: user_list.h:32
int main(int argc, char *argv[])
the main function of para_audiod
Definition: audiod.c:1454
#define RSA_DECRYPT_SEXP
S-expression for decryption.
Definition: gcrypt.c:113
#define HASH2_SIZE
Size of the hash value in bytes.
Definition: crypt.h:205
int mp4_open(const struct mp4_callback *cb, struct mp4 **result)
Read the audio track and the metadata of an mp4 file.
Definition: mp4.c:665
@ PM_NO_PATTERN_MATCHES_EVERYTHING
If no pattern is given, loop over all rows.
Definition: afs.h:123
int(* poll_function)(struct pollfd *fds, nfds_t nfds, int timeout)
If non-NULL, use this function instead of xpoll().
Definition: sched.h:33
#define DEF_COEF_TABLE(_x)
Definition: wmadata.h:1444
@ BTR_NT_INTERNAL
Definition: buffer_tree.h:112
int attribute_check_callback(struct afs_callback_arg *aca)
Compute the attribute bit mask and check each afs info bitmap.
Definition: attribute.c:449
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: recv.c:23
int task_get_notification(const struct task *t)
Return the notification value of a task.
Definition: sched.c:311
exported symbols from close_on_fork.c
int get_btr_sample_rate(struct btr_node *btrn, int32_t *result)
Ask parent btr nodes for the sample rate of the current stream.
Definition: write_common.c:205
#define SOL_DCCP
Linux socket level.
Definition: net.h:7
void oac_custom_header_init(int serial, struct oac_custom_header *h)
Set the serial number of an allocated header structure.
Definition: ogg_afh_common.c:381
int read_asf_header(const char *buf, int loaded, struct asf_header_info *ahi)
Read an asf audio file header.
Definition: wma_common.c:87
#define DEFINE_BLOB_COMPLETER(cmd, blob_type)
Definition: client.c:461
int hash_compare(const unsigned char *h1, const unsigned char *h2)
Compare two hashes.
Definition: crypt_common.c:150
@ CWS_HAVE_HEADER
Wav hader was detected.
Definition: check_wav.c:24
#define PRIVATE_OPENSSH_KEY_HEADER
Private OPENSSH keys (RFC4716) start with this header.
Definition: crypt_common.c:261
char ** argv
Vector of words in buffer.
Definition: interactive.h:12
void sc_crypt(struct stream_cipher *sc, struct iovec *src, struct iovec *dst)
Encrypt or decrypt a buffer using a stream cipher.
Definition: gcrypt.c:657
__must_check __malloc __printf_1_2 char * make_message(const char *fmt,...)
Allocate a sufficiently large string and print into it.
Definition: string.c:237
Completion information returned by the completers.
Definition: interactive.h:18
Describes one client, connected to a paraslash sender.
Definition: send.h:118
int aft_get_row_of_path(const char *path, struct osl_row **row)
Get the row of the audio file table corresponding to the given path.
Definition: aft.c:429
bool filename_completion_desired
Whether standard filename completion should be performed.
Definition: interactive.h:22
para_buffer_flags
Flags that change how content is printed into the buffer.
Definition: string.h:6
void id3_field_init(union id3_field *field, enum id3_field_type type)
struct btr_node * btr_parent(const struct btr_node *btrn)
Get the parent node of a buffer tree node.
Definition: buffer_tree.c:1288
int get_afsi_of_row(const struct osl_row *row, struct afs_info *afsi)
Get the audio file selector info, given a row of the audio file table.
Definition: aft.c:490
void client_close(struct client_task *ct)
Close the connection to para_server and free all resources.
Definition: client_common.c:39
void para_install_sighandler(int)
Install the generic signal handler for the given signal number.
Definition: signal.c:160
int mp4_update_meta(struct mp4 *f)
Write back the modified metadata items to the mp4 file.
Definition: mp4.c:1002
btr_command_handler execute
Answer a buffer tree query.
Definition: recv.h:78
int i9e_poll(struct pollfd *fds, nfds_t nfds, int timeout)
Wrapper for poll(2) which handles EINTR and returns paraslash error codes.
Definition: interactive.c:607
void * context
Points usually to the struct that contains the node pointer.
Definition: buffer_tree.h:164
int acl_check_access(int fd, struct list_head *acl, int default_deny)
Check whether the peer name of a given fd is allowed by an acl.
Definition: acl.c:154
int para_reap_child(pid_t *pid)
Reap one child.
Definition: signal.c:99
int(* post_monitor)(struct sched *s, void *context)
Receive data and make it available to consumers.
Definition: recv.h:71
#define FOR_EACH_AUDIO_FORMAT(i)
Iterate over each supported audio format.
Definition: afh_common.c:75
const char * name
Printed at startup.
Definition: gui.h:28
#define MAX_STREAM_SLOTS
Maximal number of simultaneous instances.
Definition: audiod.c:99
struct signal_task * signal_init_or_die(void)
Initialize the paraslash signal subsystem.
Definition: signal.c:35
char * parse_cidr(const char *cidr, char *addr, ssize_t addrlen, int32_t *netmask)
Parse and validate IPv4 address/netmask string.
Definition: net.c:40
const struct user * u
The paraslash user that executes this command.
Definition: command.h:6
int get_btr_channels(struct btr_node *btrn, int32_t *result)
Ask parent btr nodes for the channel count of the current stream.
Definition: write_common.c:218
int shm_attach(int id, enum shm_attach_mode mode, void **result)
Attach a shared memory segment.
Definition: ipc.c:150
struct misc_meta_data * mmd
Pointer to shared memory area for communication between para_server and its children.
Definition: server.c:52
int fec_new(int k, int n, struct fec_parms **parms)
Create a new encoder and return an opaque descriptor to it.
Definition: fec.c:458
#define MAX_CQ_BYTES
Clients will be kicked if there are more than that many bytes pending.
Definition: send_common.c:31
int mmap_full_file(const char *filename, int open_mode, void **map, size_t *size, int *fd_ptr)
Open a file and map it into memory.
Definition: fd.c:435
const struct sender udp_sender dccp_sender http_sender
The HTTP sender.
Definition: http_send.c:273
#define ARRAY_SIZE(arr)
Get the size of an array.
Definition: para.h:158
size_t btr_get_input_queue_size(const struct btr_node *btrn)
Return the amount of available input bytes of a buffer tree node.
Definition: buffer_tree.c:849
lsu_merge_cf_flags
Flags for lsu_merge_config_file_options().
Definition: lsu.h:10
char * techinfo
Audio handler specific info about the file.
Definition: afh.h:31
@ MCF_DONT_FREE
After the two lopsub parse results have been merged, the merged parse result usually becomes the effe...
Definition: lsu.h:30
void daemon_drop_privileges_or_die(const char *username, const char *groupname)
Give up superuser privileges.
Definition: daemon.c:349
int check_wav_post_monitor(struct check_wav_context *cwc)
Filter out the wav header, pushdown everything else.
Definition: check_wav.c:124
int mp4_open_meta(const struct mp4_callback *cb, struct mp4 **result)
Open an mp4 file in metadata-only mode.
Definition: mp4.c:844
size_t btr_next_buffer_omit(const struct btr_node *btrn, size_t omit, char **bufp)
Obtain the next buffer of the input queue, omitting data.
Definition: buffer_tree.c:651
int mp_parse_regex_pattern(const char *src, struct mp_re_pattern *result)
Parse and compile an extended regular expression pattern, including flags.
Definition: mp.c:157
__must_check __malloc char * para_strdup(const char *s)
Paraslash's version of strdup().
Definition: string.c:154
void daemon_log_welcome(const char *name)
Log the startup message containing the paraslash version.
Definition: daemon.c:315
void vss_init(int afs_socket, struct sched *s)
Initialize the virtual streaming system task.
Definition: vss.c:1165
void score_clear(void)
Remove all entries from the score table, but keep the table open.
Definition: score.c:319
void vss_shutdown(void)
Turn off the virtual streaming system.
Definition: vss.c:1203
#define BLOCK_MAX_SIZE
Definition: wmadec_filter.c:37
int score_delete(const struct osl_row *aft_row)
Remove an entry from the rbtree of admissible files.
Definition: score.c:247
int lines_min
Minimal admissible number of lines to display this theme.
Definition: gui.h:40
@ SBD_COMMAND
Definition: sideband.h:66
void daemon_set_loglevel(int loglevel)
Control the verbosity for logging.
Definition: daemon.c:150
__printf_2_0 unsigned xvasprintf(char **result, const char *fmt, va_list ap)
Print a formatted message to a dynamically allocated string.
Definition: string.c:181
void deplete_close_on_fork_list(void)
Remove all listed fds from the close on fork list.
Definition: close_on_fork.c:98
Describes one node of the abstract syntax tree.
Definition: mp.h:70
__printf_3_4 void mp_parse_error(int line, struct mp_context *ctx, const char *fmt,...)
Set the error bit in the parser context and log a message.
Definition: mp.c:231
@ NUM_SB_DESIGNATORS
Definition: sideband.h:66
const struct mixer oss_mixer
The mixer operations for the OSS mixer.
Definition: oss_mix.c:135
const struct filter * filter_get(int filter_num)
Obtain a reference to a filter structure.
Definition: filter_common.c:32
audio_file_table_columns
The columns of the audio file table.
Definition: aft.c:201
#define INITIALIZED_LIST_HEAD(name)
Define an initialized list head.
Definition: list.h:25
int(* client_cmds[NUM_SENDER_CMDS])(struct sender_command_data *)
Array of function pointers for the sender subcommands.
Definition: send.h:100
void btr_drain(struct btr_node *btrn)
Clear the input queue of a buffer tree node.
Definition: buffer_tree.c:792
@ AFHI_SECONDS_TOTAL_OFFSET
Where the number of seconds is stored.
Definition: aft.c:297
struct gui_color_spec cmd
Color of the name and args of the executing process.
Definition: gui.h:48
int i9e_extract_completions(const char *word, char **string_list, char ***result)
Return the possible completions for a given word.
Definition: interactive.c:635
struct afs_info * old_afsi
Afs info before the change.
Definition: afs.h:73
int shm_new(size_t size)
Create a new shared memory area of given size.
Definition: ipc.c:116
char * stat_item_values[NUM_STAT_ITEMS]
The array of status items sent by para_server.
Definition: audiod.c:161
void shutdown_client(struct sender_client *sc, struct sender_status *ss)
Shut down a client connected to a paraslash sender.
Definition: send_common.c:45
@ FEC_STATE_DISABLED
temporarily disabled
Definition: vss.c:125
void btr_pushdown(struct btr_node *btrn)
Feed all buffer references of the input queue through the output channel.
Definition: buffer_tree.c:532
#define SAMPLE_FORMATS
The sample formats supported by paraslash.
Definition: para.h:199
int recv_cred_buffer(int, char *, size_t)
Receive a buffer and the Unix credentials of the sending process.
Definition: net.c:1083
uint8_t audio_format_id
Needed to get the audio file header.
Definition: afh.h:69
Callback structure provided by audio format handlers.
Definition: ogg_afh_common.h:21
#define COMMAND_BUF_SIZE
Stdout/stderr of the executing process is read in chunks of this size.
Definition: gui.c:144
int attribute_check_callback(struct afs_callback_arg *aca)
Compute the attribute bit mask and check each afs info bitmap.
Definition: attribute.c:449
unsigned ringbuffer_filled(struct ringbuffer *rb)
Get the number of entries in the ring buffer.
Definition: ringbuffer.c:98
int max_clients
The maximal number of simultaneous connections.
Definition: send.h:181
void sched_request_timeout_ms(long unsigned ms, struct sched *s)
Bound the I/O timeout to at most the given amount of milliseconds.
Definition: sched.c:391
@ ATTRIBUTE_RENAME
An attribute was renamed.
Definition: afs.h:35
void tv_divide(const unsigned long divisor, const struct timeval *tv, struct timeval *result)
Compute a fraction of given struct timeval.
Definition: time.c:107
#define MP_TAG(_name)
Define a function which extracts and returns the value of a meta tag.
Definition: mp.c:423
unsigned input_skip
Do not try to match the first inputs of lpr.
Definition: afs.h:143
#define VLCBITS
Definition: wmadec_filter.c:128
unsigned parse_quoted_string(const char *src, const char quote_chars[2], char **result)
Parse a (generalized) string literal.
Definition: mp.c:84
void(* close)(void)
Gets called on shutdown and on SIGHUP.
Definition: afs.h:81
void theme_init(const char *name, struct gui_theme *t)
Initialize a theme.
Definition: gui_theme.c:393
uint16_t max_slice_bytes
Maximal slice size.
Definition: server.h:21
#define TRANSFORM_ZERO(a0, a1, a2, a3)
Definition: imdct.c:134
int check_writer_arg_or_die(const char *wa, struct lls_parse_result **lprp)
Check if the given string is a valid command line for any writer.
Definition: write_common.c:79
@ CRT_TERM_RQ
Someone wants us for dead (com_quit()).
Definition: play.c:57
size_t btr_pool_size(const struct btr_pool *btrp)
Return the size of the buffer pool area.
Definition: buffer_tree.c:106
unsigned int vss_paused(void)
Check if the vss is currently paused.
Definition: vss.c:781
int sched_request_barrier(struct timeval *barrier, struct sched *s)
Bound the I/O timeout by an absolute time in the future.
Definition: sched.c:409
ls_listing_mode
The different listing modes of the ls command.
Definition: aft.c:69
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: upgrade_db.c:25
@ AFHI_HEADER_LEN_OFFSET
Definition: aft.c:305
uint16_t mp4_get_channel_count(const struct mp4 *f)
Return the number of channels of the audio track.
Definition: mp4.c:811
@ SBD_NOTICE_LOG
Definition: sideband.h:66
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: client.c:23
int para_listen_simple(unsigned l4type, uint16_t port)
Create a socket which listens on all network addresses.
Definition: net.c:580
int bits
Number of bits of the table.
Definition: bitstream.h:24
char *(* status)(void)
Return current status info about this sender.
Definition: send.h:66
Used as data for afs_event() for events of type ATTRIBUTE_ADD.
Definition: afs.h:59
int send_queued_chunks(int fd, struct chunk_queue *cq)
Try to empty the chunk queue for this fd.
Definition: send_common.c:83
int decode_public_key(const char *filename, unsigned char **blob, size_t *decoded_size)
Perform sanity checks and base64-decode an ssh-rsa key.
Definition: crypt_common.c:88
int oac_rewrite_tags(const char *map, size_t mapsize, int fd, char *meta_packet, size_t meta_sz)
Change meta tags of ogg files.
Definition: ogg_afh_common.c:225
int get_afsi_of_row(const struct osl_row *row, struct afs_info *afsi)
Get the audio file selector info, given a row of the audio file table.
Definition: aft.c:490
#define OPT_STRING_VAL(_cmd, _opt)
Definition: mixer.c:40
int(* open)(struct receiver_node *rn)
Open one instance of the receiver.
Definition: recv.h:58
@ NO_ADMISSIBLE_FILES
No admissible audio file was found.
Definition: afs.h:115
__must_check int strwidth(const char *s, size_t *result)
Compute the width of an UTF-8 string.
Definition: string.c:1001
const struct sender *const senders[]
NULL-terminated list, defined in vss.c.
Definition: vss.c:39
int get_btr_sample_format(struct btr_node *btrn, int32_t *result)
Ask parent btr nodes for the number of bits per sample and the byte sex.
Definition: write_common.c:231
@ COLOR_MSG
Definition: gui.c:77
int for_each_stat_item(char *item_buf, size_t num_bytes, int(*item_handler)(int, char *))
Call a function for each complete status item of a buffer.
Definition: stat.c:31
uint8_t slices_per_group
Number of data slices plus redundant slices.
Definition: server.h:23
bool sockaddr_equal(const struct sockaddr *sa1, const struct sockaddr *sa2)
Compare the address part of IPv4/6 addresses.
Definition: net.c:738
#define SERVER_CMD_OPT_GIVEN(_cmd, _opt, _lpr)
How many times an option was given.
Definition: command.h:43
const struct filter lsg_filter_cmd_com_mp3dec_user_data
Definition: mp3dec_filter.c:187
const struct mixer alsa_mixer
The mixer operations for the ALSA mixer.
Definition: alsa_mix.c:216
int i9e_open(struct i9e_client_info *ici, struct sched *s)
Register the i9e task and initialize readline.
Definition: interactive.c:444
void hash2_to_asc(const unsigned char *hash, char *asc)
Convert a hash2 value to ascii format.
Definition: crypt_common.c:163
Theme definition.
Definition: gui.h:26
int connect_local_socket(const char *name)
Prepare, create, and connect to a Unix domain socket for local communication.
Definition: net.c:988
int(* mixer_subcommand_handler_t)(const struct mixer *)
Definition: mixer.c:43
int main(int argc, char **argv)
The main function of para_afh.
Definition: afh.c:210
void i9e_signal_dispatch(int sig_num)
Tell i9e that the caller received a signal.
Definition: interactive.c:580
const char * status_item_list[]
The list of all status items used by para_{server,audiod,gui}.
Definition: filter.c:34
int(* post_monitor)(struct sched *s, void *context)
Perform I/O on file descriptors which are ready for I/O.
Definition: sched.h:67
@ SBD_CRIT_LOG
Definition: sideband.h:66
#define MAX_ERRORS
Give up decoding after that many errors.
Definition: aacdec_filter.c:22
@ NO_PERMISSION_REQUIRED
Definition: user_list.h:14
#define KEY_TYPE_TXT
If the key begins with this text, we treat it as an ssh key.
Definition: crypt_common.c:17
bool btr_no_parent(const struct btr_node *btrn)
Find out whether a node is an orphan.
Definition: buffer_tree.c:582
@ LS_SORT_BY_LYRICS_ID
-s=y
Definition: aft.c:61
void btr_drain(struct btr_node *btrn)
Clear the input queue of a buffer tree node.
Definition: buffer_tree.c:792
struct btr_node * audiod_get_btr_root(void)
Return the root node of the current buffer tree.
Definition: audiod.c:685
void daemon_set_log_color_or_die(const char *arg)
Set the color for log messages of the given severity level.
Definition: daemon.c:65
int point
Cursor position.
Definition: interactive.h:11
int sched_request_barrier_or_min_delay(struct timeval *barrier, struct sched *s)
Bound the I/O timeout or request a minimal delay.
Definition: sched.c:430
@ AFTCOL_CHUNKS
The chunk table info and the chunk table of the audio file.
Definition: upgrade_db.c:124
int makesock(unsigned l4type, bool passive, const char *host, uint16_t port_number, struct flowopts *fo)
Resolve IPv4/IPv6 address and create a ready-to-use active or passive socket.
Definition: net.c:512
@ SBD_OUTPUT
Definition: sideband.h:66
struct btr_pool * btr_pool_new(const char *name, size_t area_size)
Create a new buffer pool.
Definition: buffer_tree.c:70
int argc
Number of elements(words) in argv.
Definition: interactive.h:13
char * album
TALB/ALBUM/alb.
Definition: afh.h:19
void extract_v4_addr(const struct sockaddr_storage *ss, struct in_addr *ia)
Extract IPv4 or IPv6-mapped-IPv4 address from sockaddr_storage.
Definition: net.c:721
void hash_to_asc(const unsigned char *hash, char *asc)
Convert a hash value to ascii format.
Definition: crypt_common.c:138
#define PAD64
Definition: base64.c:54
int i9e_print_completions(struct i9e_completer *completers)
Print possible completions to stdout.
Definition: interactive.c:739
void btr_copy(const void *src, size_t n, struct btr_pool *btrp, struct btr_node *btrn)
Copy data to write head of a buffer pool and feed it to all children nodes.
Definition: buffer_tree.c:494
bool need_periodic_header
Whether the header must be sent periodically.
Definition: send.h:151
#define AFH_RECV_CMD
Definition: play.c:115
uint32_t seconds_total
The length of the audio file in seconds.
Definition: afh.h:29
#define NUM_COMPARE(x, y)
evaluates to 1 if x < y, to -1 if x > y and to 0 if x == y
Definition: afs.h:287
int main(int argc, char *argv[])
Para_write's main function.
Definition: write.c:140
pid_t afs_pid
The process id of the audio file selector process.
Definition: server.c:86
void sc_free(struct stream_cipher *sc)
Deallocate a stream cipher structure.
Definition: gcrypt.c:649
void task_notify(struct task *t, int err)
Set the notification value of a task.
Definition: sched.c:291
int playlist_load(const char *name, struct playlist_instance **result, char **msg)
Populate the score table from the paths of a playlist database object.
Definition: playlist.c:149
struct sb_context * sb_new_send(struct sb_buffer *sbb, bool dont_free, sb_transformation t, void *trafo_context)
Prepare to write a sideband packet.
Definition: sideband.c:62
char * remote_name(int fd)
Look up the remote side of a connected socket structure.
Definition: net.c:684
Audio format dependent information.
Definition: afh.h:25
#define DCCP_SOCKOPT_CCID
Sets both TX/RX CCID.
Definition: dccp_recv.c:31
void hash_to_asc(const unsigned char *hash, char *asc)
Convert a hash value to ascii format.
Definition: crypt_common.c:138
void user_list_init(const char *user_list_file)
Initialize the list of users allowed to connect to para_server.
Definition: user_list.c:70
int main(int argc, char *argv[])
The main function of para_play.
Definition: play.c:1198
struct lls_parse_result * server_lpr
The active value for all config options of para_server.
Definition: server.c:60
void valid_fd_012(void)
Ensure that file descriptors 0, 1, and 2 are valid.
Definition: fd.c:569
@ PLAY_MODE_PLAYLIST
All listed files are admissible.
Definition: afs.h:94
int btr_exec_up(const struct btr_node *btrn, const char *command, char **value_result)
Execute an inter-node command on the given node or on a parent node.
Definition: buffer_tree.c:952
int default_port
Default TCP/DCCP port number for addresses w/o port.
Definition: send.h:175
Detect, process and cut a wav header.
struct stream_cipher_context scc
File descriptor and crypto keys.
Definition: command.h:8
int score_get_best(struct osl_row **aft_row, long *score)
Get the admissible audio file with highest score.
Definition: score.c:223
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: filter.c:24
#define OGGDEC_MAX_OUTPUT_SIZE
Suspend decoding if output queue size is larger than that.
Definition: oggdec_filter.c:178
int main(int argc, char *argv[])
The main function of para_server.
Definition: server.c:659
char * value
An arbitrary string value.
Definition: mp4.h:50
#define WMA_FRAME_SKIP
Definition: wma.h:41
#define INIT_STDERR_LOGGING(loglevel_barrier)
Define the standard log function and activate it.
Definition: para.h:74
btr_node_type
The three different types of buffer tree nodes.
Definition: buffer_tree.h:108
int afh_rewrite_tags(int audio_format_id, void *map, size_t mapsize, struct taginfo *tags, int output_fd, const char *filename)
Create a copy of the given file with altered meta tags.
Definition: afh_common.c:476
The lopsub user data structure for server commands.
Definition: command.h:23
char * stat_item_values[NUM_STAT_ITEMS]
The array of status items sent by para_server.
Definition: audiod.c:161
void audiod_status_dump(bool force)
Send the current audiod status to all connected stat clients.
Definition: audiod_command.c:447
__a_const int images_event_handler(__a_unused enum afs_events event, __a_unused struct para_buffer *pb, __a_unused void *data)
Dummy event handler for the images table.
Definition: afs.c:1162
const struct filter * filter_get(int filter_num)
Obtain a reference to a filter structure.
Definition: filter_common.c:32
struct flowopts * flowopt_new(void)
Allocate and initialize a flowopt queue.
Definition: net.c:298
#define CMD_PTR
Definition: afh.c:21
const char * name
The name of the attribute being added.
Definition: afs.h:61
int afs_callback(struct afs_callback_arg *aca)
The "top half" of an afs command.
Definition: afs.h:181
void btr_pushdown(struct btr_node *btrn)
Feed all buffer references of the input queue through the output channel.
Definition: buffer_tree.c:532
@ AFTCOL_AFHI
The audio format handler info.
Definition: upgrade_db.c:122
int para_listen_simple(unsigned l4type, uint16_t port)
Create a socket which listens on all network addresses.
Definition: net.c:580
void i9e_close(void)
Reset the terminal and save the in-memory command line history.
Definition: interactive.c:224
@ AFTCOL_PATH
The full path in the filesystem.
Definition: aft.c:205
#define OPT_GIVEN(_name, _lpr)
Definition: upgrade_db.c:20
#define PARA_CRIT_LOG(f,...)
Definition: para.h:222
@ NUM_SCORE_COLUMNS
This table has two columns.
Definition: score.c:52
int makesock_addrinfo(unsigned l4type, bool passive, struct addrinfo *ai, struct flowopts *fo)
Create an active or passive socket.
Definition: net.c:449
Functions for printing the version string.
bool mp_is_set(const char *attr, struct mp_context *ctx)
Check whether the given attribute is set for the current audio file.
Definition: mp.c:307
void btr_add_output_dont_free(const char *buf, size_t size, struct btr_node *btrn)
Insert a buffer into the buffer tree, non-freeing variant.
Definition: buffer_tree.c:439
#define MAX_FRAME_SIZE
120ms at 48000
Definition: opusdec_filter.c:60
@ VSS_WRITE
Read-only operation on the virtual streaming system.
Definition: user_list.h:18
#define FOR_EACH_MIXER(i)
Definition: mixer.c:32
afs_server_code
Codes used for communication between the server and the afs process.
Definition: afs.h:111
void generic_com_off(struct sender_status *ss)
Deactivate a paraslash sender.
Definition: send_common.c:328
const struct filter lsg_filter_cmd_com_compress_user_data
Definition: compress_filter.c:161
void activate_grab_clients(struct sched *s)
Activate inactive grab clients if possible.
Definition: grab_client.c:151
const char * search_pattern(const char *pattern, int pattern_len, const char *buf, int buf_size)
Find the first occurrence of the given pattern.
Definition: wma_common.c:24
#define BLOCK_MIN_BITS
Definition: wmadec_filter.c:35
uint16_t mp4_get_sample_rate(const struct mp4 *f)
Return the sample rate stored in the stsd atom.
Definition: mp4.c:797
#define DCCP_SOCKOPT_TX_CCID
Set/get the TX CCID.
Definition: dccp_send.c:49
#define FILTER_CMD(_num)
Definition: filter.h:102
void para_unblock_signal(int sig)
Unblock a signal.
Definition: signal.c:195
server_cmd_handler_t handler
Pointer to the command handler.
Definition: command.h:25
int i9e_open(struct i9e_client_info *ici, struct sched *s)
Register the i9e task and initialize readline.
Definition: interactive.c:444
The task structure used for writing to stdout.
Definition: stdout.h:10
struct btr_pool * btrp
Each receiver node maintains a buffer pool for the received data.
Definition: recv.h:20
bool afh_supports_dynamic_chunks(int audio_format_id)
Tell whether an audio format handler provides chunk tables.
Definition: afh_common.c:89
void i9e_signal_dispatch(int sig_num)
Tell i9e that the caller received a signal.
Definition: interactive.c:580
int default_deny
Whether the access control list is a whitelist.
Definition: send.h:183
int check_receiver_arg(const char *ra, struct lls_parse_result **lprp)
Check if the given string is a valid receiver specifier.
Definition: recv_common.c:35
int lsu_merge_config_file_options(const char *path, const char *dflt, struct lls_parse_result **lpr, const struct lls_command *cmd, const struct lls_suite *suite, unsigned flags)
Merge command line options and config file options.
Definition: lsu.c:170
@ ATTRIBUTE_REMOVE
An attribute was removed.
Definition: afs.h:37
@ AFS_SOCKET_CHECK_FOR_WRITE
Socket fd was monitored for writing.
Definition: vss.c:47
size_t btr_pool_get_buffer(const struct btr_pool *btrp, char **result)
Obtain the current write head.
Definition: buffer_tree.c:159
@ LS_MODE_PARSER
-l=c
Definition: aft.c:75
#define EXPORT_CMD(_cmd)
Definition: mixer.c:45
int(* key_handler)(int key)
In single key mode, this callback is executed instead.
Definition: interactive.h:59
void btr_add_output_pool(struct btr_pool *btrp, size_t size, struct btr_node *btrn)
Feed data to child nodes of a buffer tree node.
Definition: buffer_tree.c:464
int main(int argc, char *argv[])
The main function of para_recv.
Definition: recv.c:63
void oac_custom_header_flush(struct oac_custom_header *h)
Force remaining packets into an ogg page.
Definition: ogg_afh_common.c:412
int shm_size(int id, size_t *result)
Get the size of a shared memory segment.
Definition: ipc.c:169
void crypt_shutdown(void)
Allocate all resources of the crypto backend.
Definition: gcrypt.c:99
@ SBD_EMERG_LOG
Definition: sideband.h:66
#define RECV_CMD_OPT_STRING_VAL(_recv, _opt, _lpr)
Definition: recv.h:87
struct chunk_queue * cq_new(size_t max_pending)
Allocate and initialize a chunk queue.
Definition: chunk_queue.c:131
int get_afhi_of_row(const struct osl_row *row, struct afh_info *afhi)
Get the audio format handler info, given a row of the audio file table.
Definition: aft.c:590
daemon_flags
Daemon log configuration flags.
Definition: daemon.h:24
fec_client_state
A FEC client is always in one of these states.
Definition: vss.c:123
__malloc char * generic_sender_status(struct sender_status *ss, const char *name)
Return a string containing the current status of a sender.
Definition: send_common.c:184
void * user_data
This pointer is propagated to each call of all methods.
Definition: mp4.h:19
int timeout
The timeout (also in milliseconds) for the next iteration.
Definition: sched.h:21
@ SBD_AFS_CB_FAILURE
Definition: sideband.h:66
void sched_shutdown(struct sched *s)
Deallocate all resources of all tasks of a scheduler instance.
Definition: sched.c:204
__malloc char * get_time_string(void)
Compute the play time based on information of the current slot.
Definition: audiod.c:294
Structures and prototypes common to audio format handlers that use the ogg container format.
const char * version_single_line(const char *pfx)
Get the version string for an executable.
Definition: version.c:17
@ AFSI_IMAGE_ID_OFFSET
Storage position of the .image_id field.
Definition: aft.c:138
_static_inline_ const char * para_strerror(int num)
Paraslash's version of strerror(3).
Definition: error.h:291
void(* close)(struct receiver_node *rn)
Close this instance of the receiver.
Definition: recv.h:67
Sched and task structures and exported symbols from sched.c.
#define HTTP_ERR_MSG
Message sent to clients that do not send a valid get request.
Definition: http_send.c:31
#define CMD_PTR
Definition: filter.c:27
#define EMBRACE(...)
Used to avoid a shortcoming in vim's syntax highlighting.
Definition: para.h:182
void user_list_init(const char *user_list_file)
Initialize the list of users allowed to connect to para_server.
Definition: user_list.c:70
int afs_cb_result_handler(struct osl_object *result, uint8_t band, void *private)
Result handler for sending data to the para_client process.
Definition: afs.c:490
struct lls_parse_result * server_lpr
The active value for all config options of para_server.
Definition: server.c:60
int aft_check_attributes(uint64_t att_mask, struct para_buffer *pb)
Iterate over all audio files and check the attribute bit mask.
Definition: aft.c:2581
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: server.c:41
int sb_get_send_buffers(struct sb_context *c, struct iovec iov[2])
Obtain pointer(s) to the sideband send buffer(s).
Definition: sideband.c:127
exported symbols from grab_client.c
#define SENDER_SUBCOMMANDS
A little preprocessor fu helps to create the sender_subcommand enumeration below and the list of send...
Definition: send.h:9
void para_install_sighandler(int sig)
Install the generic signal handler for the given signal number.
Definition: signal.c:160
void theme_prev(struct gui_theme *t)
Activate the previous available theme.
Definition: gui_theme.c:418
int(* action)(struct osl_table *table, struct osl_row *row, const char *name, void *data)
For each matching row, this function will be called.
Definition: afs.h:149
struct task * task
The client task structure.
Definition: client.h:44
void tv_add(const struct timeval *a, const struct timeval *b, struct timeval *sum)
Add two time values.
Definition: time.c:72
unsigned pidx_array_len
Mumber of elements in the above pidx array.
Definition: sched.h:31
struct sender_client * accept_sender_client(struct sender_status *ss)
Accept a connection on the socket(s) this server is listening on.
Definition: send_common.c:369
void mood_unload(struct mood_instance *m)
Free all resources of a mood instance.
Definition: mood.c:563
#define FILTER_CMD_OPT(_cmd, _opt)
Definition: filter.h:103
const char * name
Used for log messages and by get_task_list().
Definition: sched.h:43
int apc_priv_decrypt(const char *key_file, unsigned char **outbuf, unsigned char *inbuf, int inlen)
Decrypt a buffer using a private key.
Definition: gcrypt.c:494
void mp_parse_wildcard_pattern(const char *src, struct mp_wc_pattern *result)
Parse a wildcard pattern, including flags.
Definition: mp.c:197
const char * name
The command for which this completer provides completion.
Definition: interactive.h:42
unsigned flags
Subset of the cflags described in regex(3).
Definition: mp.h:29
@ AFSI_LYRICS_ID_OFFSET
Storage position of the .lyrics_id field.
Definition: aft.c:140
int apc_get_pubkey(const char *key_file, struct asymmetric_key **result)
Read an asymmetric key from a file.
Definition: gcrypt.c:427
int(* post_monitor)(struct sched *s, void *context)
Convert (filter) input data into output data.
Definition: filter.h:89
struct fec_client * vss_add_fec_client(struct sender_client *sc, struct fec_client_parms *fcp)
Add one entry to the list of active fec clients.
Definition: vss.c:671
int audio_file_loop(void *private_data, osl_rbtree_loop_func *func)
Call the given function for each file in the audio file table.
Definition: aft.c:1540
#define LLS_ERROR_BIT
Like SYSTEM_ERROR_BIT, but for errors from the lopsub library.
Definition: error.h:262
int index
Bit counter.
Definition: bitstream.h:18
int shm_attach(int id, enum shm_attach_mode mode, void **result)
Attach a shared memory segment.
Definition: ipc.c:150
@ TS_RUNNING
Task is active.
Definition: sched.c:30
void score_close(struct osl_table *t)
Free all volatile objects, then close the table.
Definition: score.c:284
int xwritev(int fd, struct iovec *iov, int iovcnt)
Write an array of buffers, handling non-fatal errors.
Definition: fd.c:64
uint8_t slices_per_group
Number of data slices plus redundant slices.
Definition: send.h:147
char ** bound_keyseqs
The array of valid key sequences for libreadline.
Definition: interactive.h:61
Structure passed to for_each_matching_row().
Definition: afs.h:129
int mp4_open_meta(const struct mp4_callback *cb, struct mp4 **result)
Open an mp4 file in metadata-only mode.
Definition: mp4.c:844
#define BACKLOG
Functions to support listening sockets.
Definition: net.h:55
void hash2_to_asc(const unsigned char *hash, char *asc)
Convert a hash2 value to ascii format.
Definition: crypt_common.c:163
@ AUDIO_FILE_REMOVE
An audio file is about to be removed.
Definition: afs.h:47
int lsu_com_help(bool long_help, const struct lls_parse_result *lpr, const struct lls_suite *suite, const char *(*aux_info_cb)(unsigned cmd_num, bool verbose), char **result, unsigned *num_chars)
A generic implementation of the help subcommand.
Definition: lsu.c:107
void vss_init(int afs_socket, struct sched *s)
Initialize the virtual streaming system task.
Definition: vss.c:1165
struct gui_color_spec dflt
Default color, see assume_default_colors(3).
Definition: gui.h:34
#define FOR_EACH_AUDIO_FORMAT(af)
Iterate over all supported audio formats.
Definition: audiod.c:190
#define OPT_STRING_VAL(_name)
Definition: gui.c:34
void crypt_shutdown(void)
Allocate all resources of the crypto backend.
Definition: gcrypt.c:99
struct i9e_completer * completers
The array of completers, one per command.
Definition: interactive.h:73
void set_max_chunk_size(struct afh_info *afhi)
Determine the maximal chunk size by investigating the chunk table.
Definition: afh_common.c:438
#define OPT_UINT32_VAL(_name)
Definition: audioc.c:37
#define NUM_SUPPORTED_MIXERS
Definition: mixer.c:31
__must_check __malloc char * para_logname(void)
Get the logname of the current user.
Definition: string.c:304
@ CL_EXECUTING
Command is executing.
Definition: client.h:20
void * private_data
Receiver-specific data.
Definition: recv.h:12
int filter_setup(const char *fa, void **conf, struct lls_parse_result **lprp)
Parse a filter command line and call the corresponding ->setup method.
Definition: filter_common.c:76
int main(int argc, char *argv[])
The client program to connect to para_server.
Definition: client.c:629
bool must_set_nonblock_flag
Whether we have to set STDOUT to nonblocking mode.
Definition: stdout.h:18
char * stat_item_values[NUM_STAT_ITEMS]
The array of status items sent by para_server.
Definition: play.c:110
char * key_value_copy(const char *src, size_t len, const char *key)
Copy the value of a key=value pair.
Definition: string.c:891
size_t btr_get_output_queue_size(const struct btr_node *btrn)
Return number of queued output bytes of a buffer tree node.
Definition: buffer_tree.c:924
#define OPT_GIVEN(_name)
Definition: play.c:37
bool sched_write_ok(int fd, const struct sched *s)
Check whether writing is possible (i.e., does not block).
Definition: sched.c:560
void user_list_deplete(void)
Remove all entries from the user list.
Definition: user_list.c:48
void mp4_close(struct mp4 *f)
Deallocate all resources associated with an mp4 file handle.
Definition: mp4.c:593
int oac_custom_header_append(ogg_packet *op, struct oac_custom_header *h)
Submit an ogg packet to a custom header structure.
Definition: ogg_afh_common.c:397
int load_afd(int shmid, struct audio_file_data *afd)
Extract a afd stored in a shared memory area.
Definition: aft.c:646
const char * stringify_port(int port, const char *transport)
Stringify port number, resolve into service name where defined.
Definition: net.c:217
@ CRT_NONE
Everybody is happy.
Definition: play.c:51
ssize_t(* read)(void *user_data, void *buffer, size_t length)
This should return the number of bytes read on success.
Definition: mp4.h:24
@ COLOR_TOP
Definition: gui.c:80
struct writer lsg_write_cmd_com_file_user_data
the init function of the file writer
Definition: file_write.c:130
void sched_shutdown(struct sched *s)
Deallocate all resources of all tasks of a scheduler instance.
Definition: sched.c:204
void set_max_chunk_size(struct afh_info *afhi)
Determine the maximal chunk size by investigating the chunk table.
Definition: afh_common.c:438
const char * status_item_list[]
The list of all status items used by para_{server,audiod,gui}.
Definition: audiod_command.c:82
int get_vlc(struct getbit_context *gbc, const struct vlc *vlc)
Parse a vlc code.
Definition: bitstream.c:172
#define COLOR_MAXLEN
"\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes
Definition: color.h:5
size_t btr_next_buffer(const struct btr_node *btrn, char **bufp)
Obtain the next buffer of the input queue of a buffer tree node.
Definition: buffer_tree.c:717
struct writer lsg_write_cmd_com_ao_user_data
Definition: ao_write.c:422
int get_audio_file_path_of_row(const struct osl_row *row, char **path)
Get the path of an audio file, given a row of the audio file table.
Definition: aft.c:527
int send_errctx(struct command_context *cc, char *errctx)
Send an error context to a client,.
Definition: command.c:215
@ AFTCOL_HASH
The hash on the content of the audio file.
Definition: aft.c:203
int fd
The signal pipe.
Definition: signal.h:10
struct stream_cipher * send
Key used for sending data.
Definition: crypt.h:115
The possible values of a node in the abstract syntax tree (AST).
Definition: mp.h:50
@ NUM_ATT_COLUMNS
Number of columns in this table.
Definition: attribute.c:30
#define GF_BITS
Code over GF(256).
Definition: fec.c:45
void mp_free_ast(struct mp_ast_node *root)
Deallocate an abstract syntax tree.
loglevels
sample_format
Definition: para.h:215
const struct timeval * now
This is set by the scheduler at the beginning of its main loop.
Definition: sched.c:47
bool btr_no_parent(const struct btr_node *btrn)
Find out whether a node is an orphan.
Definition: buffer_tree.c:582
@ AFHI_CHANNELS_OFFSET
Number of channels is stored here.
Definition: aft.c:317
uint32_t num_played
Counts how many times the file was selected.
Definition: afs.h:12
A string buffer used for para_printf().
Definition: string.h:12
unsigned int vss_playing(void)
Check if vss status flag P (playing) is set.
Definition: vss.c:748
bool uid_is_whitelisted(uid_t uid)
Lookup the given UID in the whitelist.
Definition: audiod.c:1413
size_t oac_custom_header_get(char **buf, struct oac_custom_header *h)
Return the custom header buffer and deallocate resources.
Definition: ogg_afh_common.c:437
struct lls_parse_result * lpr
The parsed command line, merged with options given in the config file.
Definition: filter.h:21
__printf_2_3 void(* para_log)(int, const char *,...)
The log function of para_gui, always set to curses_log().
Definition: gui.c:502
const char * audio_format_name(int)
audio_format_handler
Definition: afh_common.c:56
int mood_check_callback(struct afs_callback_arg *aca)
Check all moods for syntax errors.
Definition: mood.c:216
struct misc_meta_data * mmd
Pointer to shared memory area for communication between para_server and its children.
Definition: server.c:52
int recv_cred_buffer(int fd, char *buf, size_t size)
Receive a buffer and the Unix credentials of the sending process.
Definition: net.c:1083
const char *const name
Used to identify the mixer.
Definition: mix.h:22
Exported functions of acl.c.
struct mp_wc_pattern wc_pattern
Right-hand side operand of =|.
Definition: mp.h:54
#define DCCP_MAX_HEADER
Estimated worst-case length of a DCCP header including options.
Definition: dccp_send.c:101
void score_open(struct osl_table **result)
Allocate a score table instance.
Definition: score.c:308
int read_size_header(const char *buf)
Read a four-byte hex-number and return its value.
Definition: string.c:451
@ TOUCH_FLAG_VERBOSE
Activates verbose mode.
Definition: aft.c:2045
struct stream_cipher * sc_new(const unsigned char *data, int len)
Allocate and initialize an aes_ctr128 stream cipher structure.
Definition: openssl.c:480
@ CWS_NEED_HEADER
Initial state, less than WAV_HEADER_LEN bytes available.
Definition: check_wav.c:22
int connect_local_socket(const char *name)
Prepare, create, and connect to a Unix domain socket for local communication.
Definition: net.c:988
void btr_pushdown_one(struct btr_node *btrn)
Feed the next buffer of the input queue through the output channel.
Definition: buffer_tree.c:548
struct list_head client_list
The list of connected clients.
Definition: send.h:187
const struct receiver lsg_recv_cmd_com_http_user_data
Definition: http_recv.c:170
The structure of server and afs commands.
int main(int argc, char *argv[])
The main function of para_mixer.
Definition: mixer.c:570
#define FEC_SWAP(a, b)
Swap two numbers.
Definition: fec.c:237
#define GET_NUM_DIGITS(x, num)
Compute the number of (decimal) digits of a number.
Definition: aft.c:703
const struct filter lsg_filter_cmd_com_spxdec_user_data
Definition: spxdec_filter.c:305
#define ALARM_TIMEOUT
Shut down non-authorized connections after that many seconds.
Definition: server.c:46
void tv_scale(const unsigned long mult, const struct timeval *tv, struct timeval *result)
Compute integer multiple of given struct timeval.
Definition: time.c:91
#define COLOR_RESET
Switch back to normal colors.
Definition: color.h:8
int para_mkdir(const char *path)
Create a directory, don't fail if it already exists.
Definition: fd.c:401
int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr, int *loglevel)
Parse a client configuration.
Definition: client_common.c:561
@ SBD_ERROR_LOG
Definition: sideband.h:66
@ ATTCOL_BITNUM
The bit number (0-63).
Definition: attribute.c:26
__malloc char * generic_sender_status(struct sender_status *ss, const char *name)
Return a string containing the current status of a sender.
Definition: send_common.c:184
uint16_t frequency
Frequency in Hz.
Definition: afh.h:54
void sched_request_timeout(struct timeval *to, struct sched *s)
Impose an upper bound for the I/O timeout.
Definition: sched.c:375
int32_t afh_get_start_chunk(int32_t approx_chunk_num, const struct afh_info *afhi, uint8_t audio_format_id)
Find a suitable start chunk.
Definition: afh_common.c:313
@ CAB_LPR_OFFSET
Start of the (serialized) lopsub parse result.
Definition: aft.c:1571
struct btr_node * btr_parent(const struct btr_node *btrn)
Get the parent node of a buffer tree node.
Definition: buffer_tree.c:1288
The asf_header structure and public wma function declarations.
grab_flags
Flags specified as arguments to the grab command.
Definition: grab_client.c:34
void sched_monitor_writefd(int fd, struct sched *s)
Instruct the scheduler to monitor an fd for readiness for writing.
Definition: sched.c:512
int audiod_status
The current mode of operation (AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY).
Definition: audiod.c:167
struct btr_node * btr_search_node(const char *name, struct btr_node *root)
Find the node with the given name in the buffer tree.
Definition: buffer_tree.c:1203
__printf_2_3 void i9e_log(int ll, const char *fmt,...)
The log function of the i9e subsystem.
Definition: interactive.c:527
@ LS_SORT_BY_CHANNELS
-s=c
Definition: aft.c:59
int para_open(const char *path, int flags, mode_t mode)
Wrapper for the open(2) system call.
Definition: fd.c:380
#define DEFINE_BLOB_FUNCTIONS(table_name, short_name, c_short_name)
Define all functions for this blob type.
Definition: blob.c:637
struct taginfo tags
Id3 tags, vorbis comments, aac tags.
Definition: afh.h:33
#define SERVER_CMD_UINT32_VAL(_cmd, _opt, _lpr)
Fetch the (first) argument given to an option of type uint32.
Definition: command.h:47
gui_color_pair
Codes for various colors.
Definition: gui.c:73
@ LS_SORT_BY_NUM_PLAYED
-s=n
Definition: aft.c:57
struct sched sched
The scheduler instance of para_audiod.
Definition: audiod.c:125
@ PM_SKIP_EMPTY_NAME
If the data in match_column is the empty string, skip this row.
Definition: afs.h:125
const struct filter lsg_filter_cmd_com_wav_user_data
Definition: wav_filter.c:118
@ AFS_WRITE
Read-only operation on the AFS database.
Definition: user_list.h:16
struct btr_node * btrn
Stdout is always a leaf node in the buffer tree.
Definition: stdout.h:14
#define GUI_COMMANDS
Definition: gui.c:93
#define NB_LSP_COEFS
Definition: wmadata.h:79
int para_mmap(size_t length, int prot, int flags, int fd, void *map)
Paraslash's wrapper for mmap.
Definition: fd.c:351
@ BLOBCOL_NAME
The unique name of the blob.
Definition: afs.h:314
int check_writer_arg_or_die(const char *wa, struct lls_parse_result **lprp)
Check if the given string is a valid command line for any writer.
Definition: write_common.c:79
__must_check void * para_realloc(void *p, size_t size)
Paraslash's version of realloc().
Definition: string.c:116
int read_ok(int fd)
Check a file descriptor for readability.
Definition: fd.c:539
const char * search_pattern(const char *pattern, int pattern_len, const char *buf, int buf_size)
Find the first occurrence of the given pattern.
Definition: wma_common.c:24
unsigned num_listen_fds
Number of sockets to listen on, size of the two arrays below.
Definition: send.h:171
size_t btr_get_output_queue_size(const struct btr_node *btrn)
Return number of queued output bytes of a buffer tree node.
Definition: buffer_tree.c:924
bool sb_sent(struct sb_context *c, size_t nbytes)
Update the sideband context after data has been sent.
Definition: sideband.c:160
struct mp_ast_node * mp_new_ast_leaf_node(int id)
Allocate a new leaf node for the abstract syntax tree.
int find_openssh_bignum_offset(const unsigned char *data, int len)
Check header of an openssh private key and compute bignum offset.
Definition: crypt_common.c:200
#define FOR_EACH_LISTEN_FD(_n, _ss)
Iterate over all listening addresses of the http/dccp sender.
Definition: send.h:191
int mp4_update_meta(struct mp4 *f)
Write back the modified metadata items to the mp4 file.
Definition: mp4.c:1002
#define OPT_RESULT(_cmd, _opt)
Definition: mixer.c:37
int i9e_poll(struct pollfd *fds, nfds_t nfds, int timeout)
Wrapper for poll(2) which handles EINTR and returns paraslash error codes.
Definition: interactive.c:607
#define CMD_PTR
Definition: recv.c:25
#define AUTH_REQUEST_MSG
Sent by para_client to initiate the authentication procedure.
Definition: para.h:79
int para_atoi32(const char *str, int32_t *value)
Convert a string to a 32-bit signed integer value.
Definition: string.c:604
void generic_acl_deplete(struct list_head *acl)
Empty the access control list of a sender.
Definition: send_common.c:248
void get_random_bytes_or_die(unsigned char *buf, int num)
Fill a buffer with random content.
Definition: gcrypt.c:65
int score_update(const struct osl_row *aft_row, long percent)
Replace a row of the score table.
Definition: score.c:136
int for_each_line(unsigned flags, char *buf, size_t size, line_handler_t *line_handler, void *private_data)
Call a custom function for each complete line.
Definition: string.c:382
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: gui.c:27
int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
Exec the given command.
Definition: exec.c:130
#define OSL_ERRNO_TO_PARA_ERROR(num)
Set the osl error bit for the given number.
Definition: error.h:277
const struct timeval * now
This is set by the scheduler at the beginning of its main loop.
Definition: sched.c:47
@ MCF_OVERRIDE
Whether the options specified in the configuration file should override the currently effective optio...
Definition: lsu.h:18
void sc_free(struct stream_cipher *sc)
Deallocate a stream cipher structure.
Definition: gcrypt.c:649
#define list_first_entry(ptr, type, member)
Get the first element of a list.
Definition: list.h:162
int fd
The socket file descriptor.
Definition: crypt.h:111
void * private_data
Data specific to the audio format handler.
Definition: ogg_afh_common.h:35
int decode_public_key(const char *filename, unsigned char **blob, size_t *decoded_size)
Perform sanity checks and base64-decode an ssh-rsa key.
Definition: crypt_common.c:88
@ VSS_STATUS_FLAG_NEXT
Whether the 'N' flag is set.
Definition: audiod.c:114
#define CMD_PTR
Definition: upgrade_db.c:17
void sc_free(struct stream_cipher *sc)
Deallocate a stream cipher structure.
Definition: openssl.c:491
#define MAX_COMMAND_LEN
server_cmd_aux_info
Definition: command.c:45
int score_add(const struct osl_row *aft_row, long score, struct osl_table *t)
Add a (row, score) pair to the score table.
Definition: score.c:99
int cols_min
Minimal admissible number of columns to display this theme.
Definition: gui.h:42
unsigned afh_get_afhi_txt(int audio_format_num, struct afh_info *afhi, char **result)
Pretty-print the contents of a struct afh_info into a buffer.
Definition: afh_common.c:393
#define PKT_OPENSSH
OPENSSH keys (since openssh-7.8, paraslash.0.6.3)
Definition: crypt_backend.h:17
#define LLS_ERRNO_TO_PARA_ERROR(num)
Set the lopsub error bit for the error code.
Definition: error.h:280
__must_check int afh_get_chunk(long unsigned chunk_num, struct afh_info *afhi, uint8_t audio_format_id, const void *map, size_t mapsize, const char **buf, uint32_t *len, void **afh_context)
Get one chunk of audio data.
Definition: afh_common.c:248
exported symbols from fd.c
void signal_shutdown(struct signal_task *st)
Close the write end of the signal pipe, deallocate resources.
Definition: signal.c:233
struct btr_node * btrn
Stdin is always the root of a buffer tree.
Definition: stdin.h:10
int main(int argc, char *argv[])
The client program to connect to para_audiod.
Definition: audioc.c:331
int mmd_mutex
The mutex protecting the shared memory area containing the mmd struct.
Definition: server.c:77
__malloc char * format_url(const char *url, int default_port)
Pretty-print a host/port pair.
Definition: net.c:193
int check_receiver_arg(const char *ra, struct lls_parse_result **lprp)
Check if the given string is a valid receiver specifier.
Definition: recv_common.c:35
int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *diff)
Compute the difference of two time values.
Definition: time.c:42
void daemon_close_log(void)
Close the log file of the daemon.
Definition: daemon.c:275
@ SBD_DEBUG_LOG
Definition: sideband.h:66
void fec_encode(struct fec_parms *parms, const unsigned char *const *src, unsigned char *dst, int idx, int sz)
Compute one encoded slice of the given input.
Definition: fec.c:516
int open_and_update_audio_file(int *fd)
Open the audio file with highest score and set up an afd structure.
Definition: aft.c:1043
int get_attribute_text(uint64_t *atts, const char *delim, char **text)
Get a string containing the set attributes in text form.
Definition: attribute.c:385
#define OPT_UINT32_VAL(_name)
Definition: play.c:38
int write_ok(int fd)
Check a file descriptor for writability.
Definition: fd.c:556
@ ASN1_TYPE_INTEGER
The next object is an integer.
Definition: gcrypt.c:128
int send_sb(struct stream_cipher_context *scc, void *buf, size_t numbytes, int band, bool dont_free)
Send a sideband packet through a blocking file descriptor.
Definition: command.c:148
#define OPT_GIVEN(_opt, _lpr)
Definition: resample_filter.c:20
#define CLIENT_OPT_GIVEN(_name, _lpr)
Definition: client.h:52
struct sb_context * sb_new_recv(size_t max_size, sb_transformation t, void *trafo_context)
Prepare to receive a sideband packet.
Definition: sideband.c:37
void sb_free(struct sb_context *c)
Deallocate all memory associated with a sideband handle.
Definition: sideband.c:105
__printf_2_3 void(* para_log)(int, const char *,...)
The log function of para_gui, always set to curses_log().
Definition: afh.c:28
void para_sigaction(int sig, void(*handler)(int))
Install the given handler for the given signal.
Definition: signal.c:129
__printf_2_3 void i9e_log(int ll, const char *fmt,...)
The log function of the i9e subsystem.
Definition: interactive.c:527
@ PBF_SIZE_PREFIX
Prefix each buffer with its length.
Definition: string.h:8
A list head is just a pair of pointers.
Definition: list.h:17
__must_check __malloc void * alloc(size_t size)
Paraslash's version of malloc().
Definition: string.c:133
#define OPT_UINT32_VAL(_name)
Definition: filter.c:31
void get_attribute_bitmap(const uint64_t *atts, char *buf)
Return a binary representation of the given attribute value.
Definition: attribute.c:365
struct mp_re_pattern re_pattern
Right-hand side operand of =~.
Definition: mp.h:55
@ BTR_NT_LEAF
Definition: buffer_tree.h:114
@ VSS_READ
Read-write operation on the AFS database.
Definition: user_list.h:17
void cq_dequeue(struct chunk_queue *cq)
Remove the current chunk from the queue.
Definition: chunk_queue.c:83
__printf_2_3 void daemon_log(int ll, const char *fmt,...)
The log function for para_server and para_audiod.
Definition: daemon.c:444
bool sched_read_ok(int fd, const struct sched *s)
Check whether there is data to read on the given fd.
Definition: sched.c:545
unsigned flags
Definition: string.h:20
#define FEC_EOF_PACKET
Data that indicates an eof-condition for a fec-encoded stream.
Definition: para.h:176
__must_check void * para_realloc(void *p, size_t size)
Paraslash's version of realloc().
Definition: string.c:116
#define AES_CRT128_BLOCK_SIZE
AES block size in bytes.
Definition: crypt_backend.h:8
char * key_file
The RSA private key.
Definition: client.h:40
@ ATTACH_RO
Definition: ipc.h:4
void flowopt_add(struct flowopts *fo, int level, int opt, const char *name, const void *val, int len)
Append new socket option to flowopt queue.
Definition: net.c:318
#define DECL_FFT(n, n2, n4)
Definition: imdct.c:166
Structures for audio format handling (para_server).
unsigned int vss_paused(void)
Check if the vss is currently paused.
Definition: vss.c:781
void tv_add(const struct timeval *a, const struct timeval *b, struct timeval *sum)
Add two time values.
Definition: time.c:72
void check_wav_pre_monitor(struct sched *s, struct check_wav_context *cwc)
Request a minimal timeout if not idle.
Definition: check_wav.c:50
fec_group_usability
The different states of a complete FEC group.
Definition: fecdec_filter.c:252
#define FOR_EACH_FRAME(_f, _buf, _size, _ps)
Definition: wma_afh.c:17
int mutex_destroy(int id)
Destroy a mutex.
Definition: ipc.c:38
#define EXPORT_AUDIOD_CMD_HANDLER(_cmd)
Define the user_data pointer as expected by lopsub.
Definition: audiod_command.c:47
void i9e_attach_to_stdout(struct btr_node *producer)
Prepare writing to stdout.
Definition: interactive.c:193
Describes a method to convert audio data.
Definition: filter.h:44
int16_t(* table)[2]
The code and the bits table.
Definition: bitstream.h:26
bool afh_supports_dynamic_chunks(int audio_format_id)
Tell whether an audio format handler provides chunk tables.
Definition: afh_common.c:89
#define RECV_CMD(_num)
Definition: recv.h:81
int read_and_compare(int fd, const char *expectation)
Read a buffer and compare its contents to a string, ignoring case.
Definition: fd.c:278
int apc_pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf, unsigned len, unsigned char **outbuf)
Encrypt a buffer using asymmetric keys.
Definition: openssl.c:440
#define MIN_FRAME_SIZE
Definition: mp3_afh.c:29
void afh_close(void *afh_context, uint8_t audio_format_id)
Deallocate resources allocated due to dynamic chunk handling.
Definition: afh_common.c:287
void btr_merge(struct btr_node *btrn, size_t dest_size)
Combine input queue buffers.
Definition: buffer_tree.c:1147
struct btr_node * btrn
The buffer tree node.
Definition: filter.h:23
#define FOR_EACH_SENDER(_i)
Iterate over all senders.
Definition: send.h:115
int daemon_get_loglevel(void)
Get the current log level of the daemon.
Definition: daemon.c:163
const struct filter lsg_filter_cmd_com_opusdec_user_data
Definition: opusdec_filter.c:286
int shm_detach(void *addr)
Detach a shared memory segment.
Definition: ipc.c:189
void * private_data
Each filter may store any filter-specific information about the particular instance of the filter her...
Definition: filter.h:15
void print_writer_helps(bool detailed)
Print the help text of all writers to stdout.
Definition: write_common.c:153
void tv_scale(const unsigned long mult, const struct timeval *tv, struct timeval *result)
Compute integer multiple of given struct timeval.
Definition: time.c:91
const char * status_item_list[]
status items
Definition: afh_common.c:15
Lopsub Utilities, enums and public functions.
#define WRITE_CMD_OPT_UINT32_VAL(_cmd, _opt, _lpr)
Definition: write.h:61
#define OPT_UINT32_VAL(_name)
Definition: audiod.c:46
int afh_rewrite_tags(int audio_format_id, void *map, size_t mapsize, struct taginfo *tags, int output_fd, const char *filename)
Create a copy of the given file with altered meta tags.
Definition: afh_common.c:476
void free_sender_status(const struct sender_status *ss)
Deallocate all resources allocated in init_sender_status().
Definition: send_common.c:166
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: audioc.c:27
void flowopt_cleanup(struct flowopts *fo)
Deallocate all resources of a flowopts structure.
Definition: net.c:363
void add_close_on_fork_list(int fd)
Add one file descriptor to the close-on-fork list.
Definition: close_on_fork.c:32
@ LS_SORT_BY_HASH
-s=h
Definition: aft.c:65
Arguments passed to each afs callback.
Definition: afs.h:153
int load_afd(int shmid, struct audio_file_data *afd)
Extract a afd stored in a shared memory area.
Definition: aft.c:646
Used as data for afs_event() for events of type ATTRIBUTE_AFSI_CHANGE.
Definition: afs.h:69
struct gui_color_spec output
Color for stdout of the executing process.
Definition: gui.h:50
struct list_head * next
Pointer to the next list entry.
Definition: list.h:19
#define LSP_POW_BITS
Definition: wmadec_filter.c:51
unsigned loop_col_num
Determines the loop order.
Definition: afs.h:133
const struct writer * writer_get(int wid)
Return the writer structure from a writer ID.
Definition: write_common.c:44
#define OPT_STRING_VAL(_name, _lpr)
Definition: recv.c:30
int audio_file_loop(void *private_data, osl_rbtree_loop_func *func)
Call the given function for each file in the audio file table.
Definition: aft.c:1540
int makesock(unsigned l4type, bool passive, const char *host, uint16_t port_number, struct flowopts *fo)
Generic socket creation (passive and active sockets).
Definition: net.c:512
touch_flags
Flags used by the touch command.
Definition: aft.c:2041
void extract_v4_addr(const struct sockaddr_storage *ss, struct in_addr *ia)
Extract IPv4 or IPv6-mapped-IPv4 address from sockaddr_storage.
Definition: net.c:721
#define WRITE_CMD_OPT_GIVEN(_cmd, _opt, _lpr)
Definition: write.h:59
Per connection data available to command handlers.
Definition: command.h:4
int xrename(const char *oldpath, const char *newpath)
Change the name or location of a file.
Definition: fd.c:28
int i9e_print_completions(struct i9e_completer *completers)
Print possible completions to stdout.
Definition: interactive.c:739
com_add_buffer_offsets
The format of the data stored by save_audio_file_data().
Definition: aft.c:1565
struct sb_context * sb_new_recv(size_t max_size, sb_transformation t, void *trafo_context)
Prepare to receive a sideband packet.
Definition: sideband.c:37
@ HTTP_STREAMING
Definition: http_recv.c:31
@ BLOB_ADD
A new blob was added.
Definition: afs.h:49
@ LS_MODE_CHUNKS
-l=m
Definition: aft.c:74
int playlist_loop(struct playlist_instance *pi, osl_rbtree_loop_func *func, void *data)
Iterate over all admissible audio files of a playlist instance.
Definition: playlist.c:209
int cmd_num
Greater than zero indicates that a sender cmd is already queued.
Definition: server.h:11
int get_vlc(struct getbit_context *gbc, const struct vlc *vlc)
Parse a vlc code.
Definition: bitstream.c:172
char * server_get_tasks(void)
Return the list of tasks for the server process.
Definition: server.c:129
int generic_max_transport_msg_size(int sockfd)
Get the maximum transport-layer message size (MMS_S).
Definition: net.c:658
Structure passed as input to the completers.
Definition: interactive.h:8
void close_listed_fds(void)
Close all fds in the list and destroy all list entries.
Definition: close_on_fork.c:88
__must_check int sanitize_str(const char *src, size_t max_width, char **result, size_t *width)
Truncate and sanitize a (wide character) string.
Definition: string.c:1055
#define TELL_CB_DUMMY_VAL
Definition: flacdec_filter.c:93
void afh_free_header(char *header_buf, uint8_t audio_format_id)
Deallocate any resources obtained from afh_get_header().
Definition: afh_common.c:373
#define OPT_INT32_VAL(_name)
The (first) argument to a server option of type int32.
Definition: server.h:99
uint8_t band
The band designator.
Definition: sideband.h:85
@ SENDER_allow
Allow connections from given IP address(es).
Definition: send.h:27
size_t size
The size of buf.
Definition: string.h:16
@ SBD_EXIT__FAILURE
Definition: sideband.h:66
int dccp_available_ccids(uint8_t **ccid_array)
Probe the list of DCCP CCIDs configured on this host.
Definition: net.c:851
grab_mode
How to handle blocking writes for the grab client fds.
Definition: grab_client.c:24
#define gf_mul(x, y)
Multiply two GF numbers.
Definition: fec.c:74
__printf_2_3 void(* para_log)(int, const char *,...)
Definition: audiod.c:48
const struct audio_format_handler ogg_afh
The ogg vorbis audio format handler.
Definition: ogg_afh.c:182
blob_table_columns
blob_symbols
Definition: afs.h:310
struct flowopts * flowopt_new(void)
Allocate and initialize a flowopt queue.
Definition: net.c:298
#define FOR_EACH_KEY_MAP(_i)
Definition: gui.c:36
void sched_monitor_readfd(int fd, struct sched *s)
Instruct the scheduler to monitor an fd for readiness for reading.
Definition: sched.c:499
@ HTTP_SENT_GET_REQUEST
Definition: http_recv.c:31
bool daemon_init_colors_or_die(int color_arg, int color_arg_auto, int color_arg_no, bool logfile_given)
Initialize color mode if necessary.
Definition: daemon.c:108
void theme_init(const char *name, struct gui_theme *t)
Initialize a theme.
Definition: gui_theme.c:393
int get_btr_channels(struct btr_node *btrn, int32_t *result)
Ask parent btr nodes for the channel count of the current stream.
Definition: write_common.c:218
#define GF_SIZE
The largest number in GF(256)
Definition: fec.c:47
int apc_get_pubkey(const char *key_file, struct asymmetric_key **result)
Read an asymmetric key from a file.
Definition: gcrypt.c:427
int score_loop(osl_rbtree_loop_func *func, struct osl_table *t, void *data)
Call the given function for each row of the score table.
Definition: score.c:209
uint8_t data_slices_per_group
Number of slices minus number of redundant slices.
Definition: send.h:149
void * ringbuffer_get(struct ringbuffer *rb, int num)
Get one entry from a ringbuffer.
Definition: ringbuffer.c:83
@ TS_DEAD
Task has been reaped and may be removed from the task list.
Definition: sched.c:28
#define MP3DEC_MAX_FRAME
Definition: mp3dec_filter.c:74
@ SENDER_deny
Deny connections from given IP address(es).
Definition: send.h:27
void(* teardown)(const struct lls_parse_result *lpr, void *conf)
Deallocate precomputed resources.
Definition: filter.h:85
Public API for interactive sessions.
void acl_add_entry(struct list_head *acl, char *addr, int netmask)
Add an entry to an access control list.
Definition: acl.c:82
#define VSS_NOMORE
Stop playing after current audio file.
Definition: vss.h:15
void(* shutdown)(void)
Dellocate all resources.
Definition: send.h:92
int score_delete(const struct osl_row *aft_row)
Remove an entry from the rbtree of admissible files.
Definition: score.c:247
void mood_unload(struct mood_instance *m)
Free all resources of a mood instance.
Definition: mood.c:563
void btr_add_output(char *buf, size_t size, struct btr_node *btrn)
Insert a malloced buffer into the buffer tree.
Definition: buffer_tree.c:409
List of error codes and messages.
#define IS_OSL_ERROR(num)
Check whether the osl error bit is set.
Definition: error.h:268
struct task * task_register(struct task_info *info, struct sched *s)
Add a task to the scheduler task list.
Definition: sched.c:228
void *(* setup)(const struct lls_parse_result *lpr)
Prepare the filter according to command line options.
Definition: filter.h:79
void(* close)(struct writer_node *)
Close one instance of the writer.
Definition: write.h:45
__noreturn void afs_init(int socket_fd)
Initialize the audio file selector process.
Definition: afs.c:926
void print_receiver_helps(bool detailed)
Print out the help texts to all receivers.
Definition: recv_common.c:80
const struct receiver lsg_recv_cmd_com_afh_user_data
Definition: afh_recv.c:242
int compute_afhi(const char *path, char *data, size_t size, int fd, struct afh_info *afhi)
Call get_file_info() to obtain an afhi structure.
Definition: afh_common.c:160
void para_block_signal(int sig)
Block a signal for the caller.
Definition: signal.c:175
@ HEADER_LEN_OFFSET
The length of the audio file header (4 bytes).
Definition: aft.c:309
void register_writer_node(struct writer_node *wn, struct btr_node *parent, struct sched *s)
Open a writer node and register the corresponding task.
Definition: write_common.c:132
int btr_pool_get_buffers(const struct btr_pool *btrp, struct iovec iov[2])
Get references to buffers pointing to free space of the buffer pool area.
Definition: buffer_tree.c:177
__must_check __malloc char * para_strcat(char *a, const char *b)
Paraslash's version of strcat().
Definition: string.c:282
void daemon_set_hooks(void(*pre_log_hook)(void), void(*post_log_hook)(void))
Register functions to be called before and after a message is logged.
Definition: daemon.c:184
@ LS_MODE_SHORT
Default listing mode.
Definition: aft.c:70
int skip_cells(const char *s, size_t cells_to_skip, size_t *result)
Skip a given number of cells at the beginning of a string.
Definition: string.c:956
__printf_2_3 void(* para_log)(int, const char *,...)
Definition: audioc.c:40
@ AFHI_MAX_CHUNK_SIZE_OFFSET
Size of the largest chunk in bytes.
Definition: aft.c:311
int get_attribute_text(uint64_t *atts, const char *delim, char **text)
Get a string containing the set attributes in text form.
Definition: attribute.c:385
void theme_prev(struct gui_theme *t)
Activate the previous available theme.
Definition: gui_theme.c:418
int main(int argc, char *argv[])
The main function of para_filter.
Definition: filter.c:103
#define AFS_CLIENT_TIMEOUT
Shutdown connection if query has not arrived until this many seconds.
Definition: afs.c:849
int task_status(const struct task *t)
Return the status value of a task.
Definition: sched.c:324
uint64_t mp4_get_duration(const struct mp4 *f)
Compute the duration of an mp4 file.
Definition: mp4.c:716
__malloc char * audiod_get_decoder_flags(void)
Return the flags for the decoder_flags status item.
Definition: audiod.c:221
__must_check __malloc void * zalloc(size_t size)
Allocate and initialize memory.
Definition: string.c:97
const struct audio_format_handler wma_afh
The audio format handler for Windows Media Audio.
Definition: wma_afh.c:654
void cq_update(struct chunk_queue *cq, size_t sent)
Change the number of bytes sent for the current queued chunk.
Definition: chunk_queue.c:99
bool mp_eval_ast(struct mp_ast_node *root, struct mp_context *ctx)
Evaluate an abstract syntax tree, starting at the root node.
@ FEC_GROUP_USABLE_SKIP_HEADER
Use the group, but drop its audio file header.
Definition: fecdec_filter.c:258
struct timeval * vss_chunk_time(void)
Get the chunk time of the current audio file.
Definition: vss.c:169
#define BF(x, y, a, b)
Definition: imdct.c:97
#define VSS_PLAYING
Currently playing.
Definition: vss.h:21
unsigned int vss_repos(void)
Check if a reposition request is pending.
Definition: vss.c:770
#define hex(a)
Return the hex characters of the lower 4 bits.
Definition: string.c:427
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: afh.c:17
int netmask
Used for allow/deny.
Definition: server.h:17
const char * writer_name(int wid)
Return name of the writer identified by a writer ID.
Definition: write_common.c:58
int64_t mp_num_attributes_set(struct mp_context *ctx)
Count the number of attributes set.
Definition: mp.c:330
char * acl_get_contents(struct list_head *acl)
Compute a string containing the contents of an acl.
Definition: acl.c:130
Common declarations for the opus decoder and audio format handler.
int generic_max_transport_msg_size(int sockfd)
Determining maximum payload (packet) size.
Definition: net.c:658
__must_check __malloc void * arr_alloc(size_t nmemb, size_t size)
Allocate an array, abort on failure or bugs.
Definition: string.c:60
Exported symbols from chunk_queue.c.
void crypt_init(void)
Initialize the crypto backend.
Definition: openssl.c:51
uint8_t band
The sideband designator for this data packet.
Definition: afs.h:201
void close_listed_fds(void)
Close all fds in the list and destroy all list entries.
Definition: close_on_fork.c:88
__must_check __malloc void * arr_zalloc(size_t nmemb, size_t size)
Allocate and initialize an array, abort on failure or bugs.
Definition: string.c:75
void * ringbuffer_add(struct ringbuffer *rb, void *data)
Add one entry to a ringbuffer.
Definition: ringbuffer.c:63
__must_check int recv_bin_buffer(int fd, char *buf, size_t size)
Receive data from a file descriptor.
Definition: net.c:770
int fd
The file descriptor of the client.
Definition: send.h:120
const struct afs_table_operations aft_ops
The audio file table contains information about known audio files.
Definition: aft.c:2740
bool btr_inplace_ok(const struct btr_node *btrn)
Find out whether it is OK to change an input buffer.
Definition: buffer_tree.c:605
int guess_audio_format(const char *name)
Guess the audio format judging from filename.
Definition: afh_common.c:103
__malloc char * generic_sender_help(void)
Get the generic help text.
Definition: send_common.c:416
void afh_get_header(struct afh_info *afhi, uint8_t audio_format_id, void *map, size_t mapsize, char **buf, size_t *len)
Get the header of an audio file.
Definition: afh_common.c:349
@ AFS_SOCKET_READY
Socket is inactive.
Definition: vss.c:45
@ AFHI_BITRATE_OFFSET
Position of the bitrate.
Definition: aft.c:299
int(* truncate)(void *user_data)
Unlike the truncate system call, this function does not receive an offset.
Definition: mp4.h:42
void btr_add_output_pool(struct btr_pool *btrp, size_t size, struct btr_node *btrn)
Feed data to child nodes of a buffer tree node.
Definition: buffer_tree.c:464
void fec_free(struct fec_parms *p)
Deallocate a fec params structure.
Definition: fec.c:438
Structure for creating new buffer tree nodes.
Definition: buffer_tree.h:154
#define IS_SYSTEM_ERROR(num)
Check whether the system error bit is set.
Definition: error.h:265
@ AFSI_AUDIO_FORMAT_UNUSED_OFFSET
2 bytes reserved space for future usage.
Definition: aft.c:146
int lookup_address(unsigned l4type, bool passive, const char *host, int port_number, struct addrinfo **result)
Resolve an IPv4/IPv6 address.
Definition: net.c:396
void mp_parse_wildcard_pattern(const char *src, struct mp_wc_pattern *result)
Parse a wildcard pattern, including flags.
Definition: mp.c:197
#define OSL_ERROR_BIT
Like SYSTEM_ERROR_BIT, but for errors from the osl library.
Definition: error.h:259
int(* open)(const char *base_dir)
Gets called on startup and on SIGHUP.
Definition: afs.h:79
@ NUM_AFT_COLUMNS
The number of columns of this table.
Definition: upgrade_db.c:126
@ SBD_INFO_LOG
Definition: sideband.h:66
struct task * task
The task structure.
Definition: stdin.h:8
struct task * task
The task associated with this instance.
Definition: recv.h:16
int64_t intval
Constants, bitrate, frequency, etc.
Definition: mp.h:53
#define MAX_CHANNELS
Definition: wmadec_filter.c:47
#define OPT_UINT32_VAL(_name, _lpr)
Definition: write.c:30
_static_inline_ int write_buffer(int fd, const char *buf)
Write a NULL-terminated buffer.
Definition: fd.h:36
int send_afs_status(struct command_context *cc, int parser_friendly)
Get the current afs status items from the afs process and send it.
Definition: aft.c:2477
@ SCF_PARSER_FRIENDLY
Enable parser-friendly output.
Definition: audiod_command.c:56
void sched_monitor_readfd(int fd, struct sched *s)
Instruct the scheduler to monitor an fd for readiness for reading.
Definition: sched.c:499
bool daemon_init_colors_or_die(int color_arg, int color_arg_auto, int color_arg_no, bool logfile_given)
Initialize color mode if necessary.
Definition: daemon.c:108
const struct audio_format_handler spx_afh
The ogg/speex audio format handler.
Definition: spx_afh.c:257
#define TRANSFORM(a0, a1, a2, a3, wre, wim)
Definition: imdct.c:126
sb_designator
All valid sideband designators.
Definition: sideband.h:66
const char * status_item_list[]
The list of all status items.
Definition: afh_common.c:15
char * artist
TPE1 (id3v2) / ARTIST (vorbis) / ART (aac)/ author(spx)
Definition: afh.h:13
void(* pre_monitor)(struct sched *s, void *context)
Force a zero timeout if data is available in the buffer tree.
Definition: filter.h:87
struct btr_node * producer
If non-NULL, this node is attached immediately to the stdout btr node of the i9e subsystem.
Definition: interactive.h:78
#define ALL_AUDIO_FORMATS
For each audio file the number of its audio format is stored in the database.
Definition: afh_common.c:23
Describes the current status of one paraslash sender.
Definition: send.h:169
#define OPT_RESULT(_name)
Definition: afh.c:22
#define FRAME_HEADER_SIZE
Definition: mp3_afh.c:28
int(* max_size_handler)(char *buf, size_t size, void *private_data)
If an attempt to print into this buffer is made that would need to grow buf to a size larger than max...
Definition: string.h:28
void btr_consume(struct btr_node *btrn, size_t numbytes)
Deallocate the given number of bytes from the input queue.
Definition: buffer_tree.c:737
int lsu_com_help(bool long_help, const struct lls_parse_result *lpr, const struct lls_suite *suite, const char *(*aux_info_cb)(unsigned cmd_num, bool verbose), char **result, unsigned *num_chars)
A generic implementation of the help subcommand.
Definition: lsu.c:107
@ LS_SORT_BY_SCORE
-s=s
Definition: aft.c:55
#define OPT_GIVEN(_name)
Definition: audioc.c:35
@ EXEC_DCMD
para or display process running.
Definition: gui.c:63
#define SESSION_KEY_LEN
Number of bytes of the session key for stream ciphers.
Definition: crypt.h:99
int score_loop(osl_rbtree_loop_func *func, struct osl_table *t, void *data)
Call the given function for each row of the score table.
Definition: score.c:209
#define WRITE_CMD(_num)
Definition: write.h:55
#define FOR_EACH_BUFFER_REF(_br, _btrn)
Definition: buffer_tree.c:247
struct task * task_register(struct task_info *info, struct sched *s)
Add a task to the scheduler task list.
Definition: sched.c:228
int get_btr_sample_format(struct btr_node *btrn, int32_t *result)
Ask parent btr nodes for the number of bits per sample and the byte sex.
Definition: write_common.c:231
Public API of the mp4 parser.
void daemon_close_log(void)
Close the log file of the daemon.
Definition: daemon.c:275
struct list_head acl
The whitelist/blacklist.
Definition: send.h:185
const struct audio_format_handler aac_afh
The audio format handler for the Advanced Audio Codec.
Definition: aac_afh.c:255
const struct afs_table_operations aft_ops
The audio file table contains information about known audio files.
Definition: aft.c:2740
_static_inline_ int64_t update_quadratic_deviation(int64_t n, int64_t old_qd, int64_t old_val, int64_t new_val, int64_t old_sum)
Compute the new quadratic deviation in case one element changes.
Definition: mood.c:418
void(* pre_monitor)(struct sched *s, void *context)
Ask the scheduler to monitor receive fds.
Definition: recv.h:69
char * year
TDRC/YEAR/day.
Definition: afh.h:17
void parse_config_or_die(bool reload)
(Re-)read the server configuration files.
Definition: server.c:195
int channels_given
Whether the channel count was given.
Definition: check_wav.h:17
int aft_get_row_of_path(const char *path, struct osl_row **row)
Get the row of the audio file table corresponding to the given path.
Definition: aft.c:429
int top_lines_default
Default number of lines of the top window.
Definition: gui.h:36
#define PARA_INFO_LOG(f,...)
Definition: para.h:218
void sb_free(struct sb_context *c)
Deallocate all memory associated with a sideband handle.
Definition: sideband.c:105
int(* resolve_target)(const char *, struct sender_command_data *)
Resolve target-specific URL string.
Definition: send.h:109
bool dont_append_space
Suppress adding a space character after the completed word.
Definition: interactive.h:24
struct lls_parse_result * lpr
The parsed command line, merged with options given in the config file.
Definition: write.h:14
unsigned * pidx
Maps fds to indices of the pfd array.
Definition: sched.h:29
uint64_t mp4_get_duration(const struct mp4 *f)
Compute the duration of an mp4 file.
Definition: mp4.c:716
size_t min_iqs
The minimal input queue size, see btr_node_status().
Definition: filter.h:27
struct misc_meta_data * mmd
Pointer to shared memory area for communication between para_server and its children.
Definition: server.c:52
char * remote_name(int sockfd)
Pretty-printing of IPv4/6 socket addresses.
Definition: net.c:684
const char * stringify_port(int port, const char *transport)
Stringify port number, resolve into service name where defined.
Definition: net.c:217
bool btr_inplace_ok(const struct btr_node *btrn)
Find out whether it is OK to change an input buffer.
Definition: buffer_tree.c:605
int mood_loop(struct mood_instance *m, osl_rbtree_loop_func *func, void *data)
Iterate over the admissible files of a mood instance.
Definition: mood.c:689
unsigned int vss_repos(void)
Check if a reposition request is pending.
Definition: vss.c:770
void(* sb_transformation)(struct iovec *src, struct iovec *dst, void *trafo_context)
The type of a sideband transformation.
Definition: sideband.h:110
btr_command_handler execute
The callback handler.
Definition: write.h:52
int get_audio_file_path_of_row(const struct osl_row *row, char **path)
Get the path of an audio file, given a row of the audio file table.
Definition: aft.c:527
exported symbols from signal.c
int acl_check_access(int fd, struct list_head *acl, int default_deny)
Check whether the peer name of a given fd is allowed by an acl.
Definition: acl.c:154
int recv_sb(struct stream_cipher_context *scc, enum sb_designator expected_band, size_t max_size, struct iovec *result)
Receive a sideband packet from a blocking file descriptor.
Definition: command.c:294
size_t btr_get_input_queue_size(const struct btr_node *btrn)
Return the amount of available input bytes of a buffer tree node.
Definition: buffer_tree.c:849
#define FOR_EACH_FILTER(j)
Iterate over all filters.
Definition: filter_common.c:20
void init_sender_status(struct sender_status *ss, const struct lls_opt_result *acl_opt_result, const struct lls_opt_result *listen_address_opt_result, int default_port, int max_clients, int default_deny)
Initialize a struct sender status.
Definition: send_common.c:113
unsigned match_col_num
Data from this column is matched against the given patterns.
Definition: afs.h:135
int send_errctx(struct command_context *cc, char *errctx)
Send an error context to a client,.
Definition: command.c:215
#define SERVER_CMD_OPT_RESULT(_cmd, _opt, _lpr)
Get the lopsub parse result of an option.
Definition: command.h:39
@ ASN1_TYPE_SEQUENCE
Keys start with one big type sequence.
Definition: gcrypt.c:132
int num_clients
The current number of simultaneous connections.
Definition: send.h:179
#define MP_AFSI(_name)
Define a function which returns a field of the afs_info structure.
Definition: mp.c:357
void * ringbuffer_add(struct ringbuffer *rb, void *data)
Add one entry to a ringbuffer.
Definition: ringbuffer.c:63
int fec_new(int k, int n, struct fec_parms **result)
Create a new encoder and return an opaque descriptor to it.
Definition: fec.c:458
int base64_decode(char const *src, size_t encoded_size, char **result, size_t *decoded_size)
base64-decode a buffer.
Definition: base64.c:73
#define FEC_MAGIC
The FEC header starts with this magic value.
Definition: fec.h:39
int recv_buffer(int fd, char *buf, size_t size)
Receive and write terminating NULL byte.
Definition: net.c:794
#define OPT_GIVEN(_name)
Definition: audiod.c:44
@ LS_SORT_BY_AUDIO_FORMAT
-s=a
Definition: aft.c:64
struct list_head callbacks
The list of registered callbacks.
Definition: filter.h:17
Exported symbols from imdct.c.
void fec_free(struct fec_parms *p)
Deallocate a fec params structure.
Definition: fec.c:438
#define HASH_SIZE
Size of the hash value in bytes.
Definition: crypt.h:166
int decoder_execute(const char *cmd, unsigned sample_rate, unsigned channels, char **result)
Execute a btr command for a decoder.
Definition: filter_common.c:209
These come from the command line arguments.
Definition: check_wav.h:13
#define SERVER_CMD_CMD_PTR(_cmd)
Get the lopsub command pointer by command name.
Definition: command.h:35
int i9e_get_error(void)
Return the error state of the i9e task.
Definition: interactive.c:50
uint8_t channels
The number of channels.
Definition: afh.h:52
Inline functions for binary IO.
unsigned int vss_playing(void)
Check if vss status flag P (playing) is set.
Definition: vss.c:748
void sched_min_delay(struct sched *s)
Set the I/O timeout to the minimal possible value.
Definition: sched.c:359
#define PRIVATE_PEM_KEY_HEADER
Private PEM keys (legacy format) start with this header.
Definition: crypt_common.c:259
void generic_com_on(struct sender_status *ss, unsigned protocol)
Activate a paraslash sender.
Definition: send_common.c:282
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: audiod.c:39
struct stream_cipher * recv
Key used for receiving data.
Definition: crypt.h:113
#define CMD_PTR
Definition: gui.c:31
@ SBD_EXIT__SUCCESS
Definition: sideband.h:66
void sc_crypt(struct stream_cipher *sc, struct iovec *src, struct iovec *dst)
Encrypt or decrypt a buffer using a stream cipher.
Definition: openssl.c:518
struct chunk_queue * cq_new(size_t max_pending)
Allocate and initialize a chunk queue.
Definition: chunk_queue.c:131
void cq_destroy(struct chunk_queue *cq)
Deallocate all resources of this queue.
Definition: chunk_queue.c:145
void init_sender_status(struct sender_status *ss, const struct lls_opt_result *acl_opt_result, const struct lls_opt_result *listen_address_opt_result, int default_port, int max_clients, int default_deny)
Initialize a struct sender status.
Definition: send_common.c:113
@ FEC_GROUP_UNUSABLE
Drop the group (because we did not receive the header yet).
Definition: fecdec_filter.c:254
void daemon_drop_privileges_or_die(const char *username, const char *groupname)
Give up superuser privileges.
Definition: daemon.c:349
int sender_num
The number of the sender in question.
Definition: server.h:13
@ COLOR_BOT
Definition: gui.c:81
int aft_check_attributes(uint64_t att_mask, struct para_buffer *pb)
Iterate over all audio files and check the attribute bit mask.
Definition: aft.c:2581
Describes a possible data source for audio streams.
Definition: recv.h:50
int cq_enqueue(struct chunk_queue *cq, const char *buf, size_t num_bytes)
Add a chunk to the given queue.
Definition: chunk_queue.c:49
void imdct(struct mdct_context *ctx, float *output, const float *input)
Compute the inverse MDCT.
Definition: imdct.c:315
int fd
The local socket connecting afs and the command handler.
Definition: afs.h:155
@ LS_SORT_BY_DURATION
-s=d
Definition: aft.c:63
@ ATS_SEEN_MP4A
We have seen an mp4a atom but no subsequent trak atom yet.
Definition: mp4.c:33
#define U32_OPTVAL(_opt, _lpr)
Definition: resample_filter.c:19
int daemonize(bool parent_waits)
Do the usual stuff to become a daemon.
Definition: daemon.c:227
inter process communication and shared memory routines
int filter_setup(const char *fa, void **conf, struct lls_parse_result **lprp)
Parse a filter command line and call the corresponding ->setup method.
Definition: filter_common.c:76
Writing to stdout via buffer trees.
void stdin_task_register(struct stdin_task *sit, struct sched *s)
Register a stdin task structure.
Definition: stdin.c:88
size_t vss_get_fec_eof_packet(const char **buf)
Return a buffer that marks the end of the stream.
Definition: vss.c:656
@ AFHI_INFO_STRING_OFFSET
The tag info position.
Definition: aft.c:319
@ AFHI_FREQUENCY_OFFSET
Position of the frequency.
Definition: aft.c:301
#define BLOCK_NB_SIZES
Definition: wmadec_filter.c:39
__malloc struct oac_custom_header * oac_custom_header_new(void)
Allocate and return a custom header structure.
Definition: ogg_afh_common.c:368
struct lls_parse_result * lpr
Convenience pointer for the deserialized parse result.
Definition: afs.h:168
#define FOR_EACH_RECEIVER(i)
Iterate over all available receivers.
Definition: recv.h:95
unsigned afh_get_afhi_txt(int audio_format_num, struct afh_info *afhi, char **result)
Pretty-print the contents of a struct afh_info into a buffer.
Definition: afh_common.c:393
void task_notify_all(struct sched *s, int err)
Set the notification value of all tasks of a scheduler instance.
Definition: sched.c:344
int wid
The ID of this writer.
Definition: write.h:10
void free_status_items(void)
Deallocate and invalidate the status item strings.
Definition: aft.c:980
void free_vlc(struct vlc *vlc)
Deallocate all resources of a VLC table.
Definition: bitstream.c:159
afhi_offsets
The on-disk layout of a afhi struct.
Definition: aft.c:295
#define WAV_HEADER_LEN
A wav header is always 44 bytes.
Definition: wav_filter.c:17
const struct filter lsg_filter_cmd_com_prebuffer_user_data
Definition: prebuffer_filter.c:87
unsigned flags
For modifying matching behaviour.
Definition: mp.h:35
const struct writer * writer_get(int wid)
Return the writer structure from a writer ID.
Definition: write_common.c:44
int xwrite(int fd, const char *buf, size_t len)
Write a buffer to a file descriptor, re-writing on short writes.
Definition: fd.c:123
@ HTTP_CONNECTED
We accepted the connection on the tcp socket.
Definition: http_send.c:36
__printf_3_4 void mp_parse_error(int line, struct mp_context *ctx, const char *fmt,...)
Set the error bit in the parser context and log a message.
Definition: mp.c:231
int mp4_get_sample_size(const struct mp4 *f, uint32_t sample, uint32_t *result)
Look up and return the size of the given sample in the stsz table.
Definition: mp4.c:772
void free_argv(char **argv)
Free an array of words created by create_argv() or create_shifted_argv().
Definition: string.c:745
void crypt_shutdown(void)
Allocate all resources of the crypto backend.
Definition: openssl.c:63
@ FEC_GROUP_USABLE_WITH_HEADER
Use the group, including its header.
Definition: fecdec_filter.c:260
__must_check int afh_get_chunk(long unsigned chunk_num, struct afh_info *afhi, uint8_t audio_format_id, const void *map, size_t mapsize, const char **buf, uint32_t *len, void **afh_context)
Get one chunk of audio data.
Definition: afh_common.c:248
Exported functions from vss.c (para_server).
@ HTTP_INVALID_GET_REQUEST
We didn't receive a valid get request.
Definition: http_send.c:42
_static_inline_ bool iov_valid(const struct iovec *iov)
Simple sanity check for I/O vectors.
Definition: para.h:122
__printf_2_3 void(* para_log)(int, const char *,...)
Definition: client.c:32
#define CLIENT_CMD_PTR
Definition: client.h:49
__printf_2_3 int write_va_buffer(int fd, const char *fmt,...)
A fprintf-like function for raw file descriptors.
Definition: fd.c:169
int para_accept(int fd, void *addr, socklen_t size, int *new_fd)
Wrapper around the accept system call.
Definition: net.c:822
bool mp_eval_row(const struct osl_row *aft_row, struct mp_context *ctx)
Determine whether the given audio file is admissible.
Definition: mp.c:562
@ FEC_STATE_NONE
not initialized and not enabled
Definition: vss.c:124
#define OPT_GIVEN(_name)
Definition: afh.c:23
The standard in task structure.
const struct filter lsg_filter_cmd_com_resample_user_data
Definition: resample_filter.c:278
#define FEC_HEADER_SIZE
Each FEC slice contains a FEC header of this size.
Definition: fec.h:37
void daemon_set_start_time(void)
Set the startup time.
Definition: daemon.c:397
void sb_get_recv_buffer(struct sb_context *c, struct iovec *iov)
Obtain a pointer to the next sideband read buffer.
Definition: sideband.c:182
unsigned ringbuffer_filled(struct ringbuffer *rb)
Get the number of entries in the ring buffer.
Definition: ringbuffer.c:98
uint32_t max_chunk_size
Size of the largest chunk.
Definition: afh.h:67
void sched_request_timeout_ms(long unsigned ms, struct sched *s)
Bound the I/O timeout to at most the given amount of milliseconds.
Definition: sched.c:391
int read_ok(int fd)
Check a file descriptor for readability.
Definition: fd.c:539
int apc_priv_decrypt(const char *key_file, unsigned char **outbuf, unsigned char *inbuf, int inlen)
Decrypt a buffer using a private key.
Definition: openssl.c:394
__must_check void * zalloc(size_t size)
Allocate and initialize memory.
Definition: string.c:97
@ AFS_SOCKET_AFD_PENDING
vss wrote a request to the socket and waits for reply from afs.
Definition: vss.c:49
Operations provided by each mixer plugin.
Definition: mix.h:20
void register_writer_node(struct writer_node *wn, struct btr_node *parent, struct sched *s)
Open a writer node and register the corresponding task.
Definition: write_common.c:132
#define ERRNO_TO_PARA_ERROR(num)
Set the system error bit for the given number.
Definition: error.h:274
struct list_head node
The position of this user in the list of users.
Definition: user_list.h:26
@ DF_LOG_HOSTNAME
Whether the hostname should be logged.
Definition: daemon.h:26
Audio file selector data stored in the audio file table.
Definition: afs.h:6
int para_munmap(void *start, size_t length)
A wrapper for munmap(2).
Definition: fd.c:496
int base64_decode(char const *src, size_t encoded_size, char **result, size_t *decoded_size)
base64-decode a buffer.
Definition: base64.c:73
void btr_pool_free(struct btr_pool *btrp)
Deallocate resources used by a buffer pool.
Definition: buffer_tree.c:89
unsigned int vss_stopped(void)
Check if the vss is currently stopped.
Definition: vss.c:793
void daemon_set_flag(unsigned flag)
Set one of the daemon config flags.
Definition: daemon.c:197
uint16_t mp4_get_channel_count(const struct mp4 *f)
Return the number of channels of the audio track.
Definition: mp4.c:811
int send_callback_request(afs_callback *f, struct osl_object *query, callback_result_handler *result_handler, void *private_result_data)
Ask the afs process to call a given function.
Definition: afs.c:173
@ FELF_DISCARD_FIRST
Don't call line handler for the first input line.
Definition: string.h:42
@ AFSI_SIZE
On-disk storage space needed.
Definition: aft.c:148
@ CRT_FILE_CHANGE
New file should be loaded (com_next()).
Definition: play.c:55
#define CHECK_HEADER(_p, _h)
Definition: wma_afh.c:284
int imdct_init(int nbits, struct mdct_context **result)
Initialize the inverse modified cosine transform.
Definition: imdct.c:363
#define SB_DESIGNATORS_ARRAY
List of stringified sidedband designators.
Definition: sideband.h:71
int parse_fec_url(const char *arg, struct sender_command_data *scd)
Parse a FEC URL string.
Definition: send_common.c:491
@ ASN1_TYPE_BIT_STRING
Bit string object.
Definition: gcrypt.c:130
long unsigned tv2ms(const struct timeval *tv)
Convert struct timeval to milliseconds.
Definition: time.c:13
struct btr_pool * btrp
Use a buffer pool to minimize memcpy due to alignment problems.
Definition: stdin.h:12
#define PARA_ABS(x)
Compute the absolute value of x.
Definition: para.h:45
char * get_task_list(struct sched *s)
Get the list of all registered tasks.
Definition: sched.c:255
server_command_permissions
Flags for server commands and user permissions.
Definition: user_list.h:13
#define AFSI_SIZE
Definition: upgrade_db.c:129
const struct mixer alsa_mixer oss_mixer
Declared even if unsupported because it does not hurt and avoids ifdefs.
Definition: oss_mix.c:135
void shutdown_client(struct sender_client *sc, struct sender_status *ss)
Shut down a client connected to a paraslash sender.
Definition: send_common.c:45
void afh_close(void *afh_context, uint8_t audio_format_id)
Deallocate resources allocated due to dynamic chunk handling.
Definition: afh_common.c:287
#define FOR_EACH_MAPPED_KEY(i)
Definition: play.c:533
@ LS_SORT_BY_FREQUENCY
-s=f
Definition: aft.c:58
int fnmatch_flags
This value is passed verbatim to fnmatch().
Definition: afs.h:139
__malloc char * daemon_get_uptime_str(const struct timeval *current_time)
Construct a string containing the current uptime.
Definition: daemon.c:431
stat_client_flags
Flags used for the stat command of para_audiod.
Definition: audiod_command.c:54
void print_writer_helps(bool detailed)
Print the help text of all writers to stdout.
Definition: write_common.c:153
@ LS_SORT_BY_LAST_PLAYED
-s=l
Definition: aft.c:56
void signal_shutdown(struct signal_task *st)
Close the write end of the signal pipe, deallocate resources.
Definition: signal.c:233
@ SBD_CHALLENGE
Definition: sideband.h:66
ls_sorting_method
The different sorting methods of the ls command.
Definition: aft.c:53
void daemon_set_priority(int prio)
Renice the calling process.
Definition: daemon.c:328
#define FOR_EACH_CHANNEL(i)
Iterate over all defined mixer channels.
Definition: oss_mix.c:38
@ NEXT_AUDIO_FILE
An audio file was successfully opened.
Definition: afs.h:113
int(* set_channel)(struct mixer_handle *handle, const char *mixer_channel)
Select the channel for subsequent get/set operations.
Definition: mix.h:28
char * name
The socket "name" of the client.
Definition: send.h:122
struct btr_node * audiod_get_btr_root(void)
Return the root node of the current buffer tree.
Definition: audiod.c:685
#define OPT_STRING_VAL(_name)
Definition: afh.c:24
int sched_request_barrier_or_min_delay(struct timeval *barrier, struct sched *s)
Bound the I/O timeout or request a minimal delay.
Definition: sched.c:430
uint32_t header_len
The header is needed by senders in case a new client connects in the middle of the stream.
Definition: afh.h:50
const struct receiver lsg_recv_cmd_com_udp_user_data
Definition: udp_recv.c:189
__malloc char * mp4_get_tag_value(const struct mp4 *f, const char *item)
Return the value of the given tag item.
Definition: mp4.c:1050
int write_ok(int fd)
Check a file descriptor for writability.
Definition: fd.c:556
struct misc_meta_data * mmd
Pointer to shared memory area for communication between para_server and its children.
Definition: server.c:52
int find_openssh_bignum_offset(const unsigned char *data, int len)
Check header of an openssh private key and compute bignum offset.
Definition: crypt_common.c:200
int send_sb(struct stream_cipher_context *scc, void *buf, size_t numbytes, int band, bool dont_free)
Send a sideband packet through a blocking file descriptor.
Definition: command.c:148
char * history_file
Where to store the readline history.
Definition: interactive.h:67
void compute_chunk_time(long unsigned chunk_num, struct timeval *chunk_tv, struct timeval *stream_start, struct timeval *result)
Compute when to send a chunk of an audio file.
Definition: time.c:170
A variable length code table.
Definition: bitstream.h:22
void sc_crypt(struct stream_cipher *sc, struct iovec *src, struct iovec *dst)
Encrypt or decrypt a buffer using a stream cipher.
Definition: gcrypt.c:657
@ CL_RECEIVED_CHALLENGE
Server sends encrypted challenge.
Definition: client.h:14
struct timeval * vss_chunk_time(void)
Get the chunk time of the current audio file.
Definition: vss.c:169
pid_t afs_pid
The process id of the audio file selector process.
Definition: server.c:86
const struct filter lsg_filter_cmd_com_amp_user_data
Definition: amp_filter.c:100
#define FOR_EACH_CHILD_SAFE(_tn, _tmp, _btrn)
Definition: buffer_tree.c:244
struct slot_info slot[5]
para_audiod uses MAX_STREAM_SLOTS different slots, each of which may be associated with a receiver/fi...
Definition: audiod.c:109
#define PARA_MAX(x, y)
Compute the maximum of x and y.
Definition: para.h:38
The task structure used for reading from stdin.
Definition: stdin.h:6
int64_t mp_year(struct mp_context *ctx)
Parse and return the value of the year tag.
Definition: mp.c:447
uint8_t audio_format_id
Mp3, ogg, ...
Definition: afs.h:18
__must_check __malloc char * para_homedir(void)
Get the home directory of the calling user.
Definition: string.c:319
void free_lpr(void)
Deallocate all lopsub parse results.
Definition: server.c:644
uint16_t bitrate
Exact meaning depends on audio format.
Definition: afh.h:56
Describes one running instance of a writer.
Definition: write.h:8
@ CHUNK_TV_TV_SEC_OFFSET
The seconds part of the chunk time (4 bytes).
Definition: aft.c:313
__must_check __malloc void * arr_alloc(size_t nmemb, size_t size)
Allocate an array, abort on failure or bugs.
Definition: string.c:60
void hash_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash of the given input data.
Definition: gcrypt.c:33
void valid_fd_012(void)
Ensure that file descriptors 0, 1, and 2 are valid.
Definition: fd.c:569
struct osl_table * table
Loop over all rows in this table.
Definition: afs.h:131
__printf_2_3 void daemon_log(int ll, const char *fmt,...)
The log function for para_server and para_audiod.
Definition: daemon.c:444
Arguments for the sender command.
Definition: server.h:9
bool sched_read_ok(int fd, const struct sched *s)
Check whether there is data to read on the given fd.
Definition: sched.c:545
const char * name
The name of the sender.
Definition: send.h:48
const struct sender dccp_sender
The DCCP sender.
Definition: dccp_send.c:258
_static_inline_ void signal_pre_monitor(struct sched *s, void *context)
Monitor the signal fd for reading.
Definition: signal.h:30
__printf_2_3 void(* para_log)(int, const char *,...)
The log function of para_gui, always set to curses_log().
Definition: play.c:108
struct timeval * clock_get_realtime(struct timeval *tv)
Retrieve the time of the realtime clock.
Definition: time.c:194
void sb_get_recv_buffer(struct sb_context *c, struct iovec *iov)
Obtain a pointer to the next sideband read buffer.
Definition: sideband.c:182
struct lls_parse_result * lpr
The parsed command line (including the command).
Definition: client.h:38
struct btr_node * btr_new_node(struct btr_node_description *bnd)
Create a new buffer tree node.
Definition: buffer_tree.c:263
@ CAB_AUDIO_FORMAT_ID_OFFSET
Audio format id.
Definition: aft.c:1573
Data about the current audio file, passed from afs to server.
Definition: afh.h:60
@ HTTP_STREAMING
Connection is ready for sending audio data.
Definition: http_send.c:40
Sender-related defines and structures.
char * parse_url(const char *url, char *host, ssize_t hostlen, int32_t *port)
Parse and validate URL string.
Definition: net.c:142
void clear_afhi(struct afh_info *afhi)
Deallocate the contents of an afh_info structure.
Definition: afh_common.c:209
char * item
The item name: "artist", "title", "album", "comment", or "date".
Definition: mp4.h:48
#define MAX_HOSTLEN
The maximum length of the host component in an URL.
Definition: net.h:11
Exported symbols from fec.c.
sender_subcommand
Each sender subcommand gets an SENDER_xxx identifier.
Definition: send.h:26
Non-public crypto interface.
unsigned num_pfds
Number of fds registered for montitoring so far.
Definition: sched.h:27
#define CMD_PTR
Get a reference to the supercommand of para_server.
Definition: server.c:185
int(* post_monitor)(struct sched *s, void *context)
Write audio data.
Definition: write.h:39
__printf_2_3 void(* para_log)(int, const char *,...)
Definition: afh.c:28
int playlist_check_callback(struct afs_callback_arg *aca)
Check the playlist table for inconsistencies.
Definition: playlist.c:105
void i9e_complete_option(char **opts, struct i9e_completion_info *ci, struct i9e_completion_result *cr)
Complete according to the given options.
Definition: interactive.c:711
_static_inline_ int lls(int ret)
Wrapper for lopsub library calls.
Definition: error.h:333
void generic_com_off(struct sender_status *ss)
Deactivate a paraslash sender.
Definition: send_common.c:328
int mutex_destroy(int id)
Destroy a mutex.
Definition: ipc.c:38
const uint16_t * levels
Table to build run/level tables.
Definition: wmadata.h:33
uint32_t mp4_num_samples(const struct mp4 *f)
Return the number of samples of the audio track.
Definition: mp4.c:823
vss_status_flags
The vss status flags audiod is interested in.
Definition: audiod.c:112
void i9e_attach_to_stdout(struct btr_node *producer)
Prepare writing to stdout.
Definition: interactive.c:193
#define VSS_REPOS
A reposition request was sent by a client.
Definition: vss.h:19
const char * writer_name(int wid)
Return name of the writer identified by a writer ID.
Definition: write_common.c:58
int64_t mp_duration(struct mp_context *ctx)
Return the duration of the audio file from the afh info structure.
Definition: mp.c:402
#define FOR_EACH_FIELD(f, j, fr)
Definition: mp3_afh.c:99
bool mp_is_set(const char *attr, struct mp_context *ctx)
Check whether the given attribute is set for the current audio file.
Definition: mp.c:307
for_each_line_flags
Controls the behavior of for_each_line().
Definition: string.h:38
int port
The port number for add/remove.
Definition: server.h:19
#define OPT_STRING_VAL(_name)
Definition: audioc.c:36
int daemon_get_loglevel(void)
Get the current log level of the daemon.
Definition: daemon.c:163
int btr_exec_up(const struct btr_node *btrn, const char *command, char **value_result)
Execute an inter-node command on the given node or on a parent node.
Definition: buffer_tree.c:952
void crypt_init(void)
Initialize the crypto backend.
Definition: gcrypt.c:75
void activate_grab_clients(struct sched *s)
Activate inactive grab clients if possible.
Definition: grab_client.c:151
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: play.c:30
@ ATTACH_RW
Definition: ipc.h:4
void theme_next(struct gui_theme *t)
Activate the next available theme.
Definition: gui_theme.c:431
uint16_t mp4_get_sample_rate(const struct mp4 *f)
Return the sample rate stored in the stsd atom.
Definition: mp4.c:797
uint32_t num_bits
Length of buffer in bits (always a multiple of 8).
Definition: bitstream.h:16
int playlist_check_callback(struct afs_callback_arg *aca)
Check the playlist table for inconsistencies.
Definition: playlist.c:105
attribute_table_columns
The columns of the attribute table.
Definition: attribute.c:24
unsigned pm_flags
Definition: afs.h:137
int para_listen(unsigned l4type, const char *addr, uint16_t port)
Create a passive / listening socket.
Definition: net.c:542
struct lls_parse_result * lpr
The parsed command line options for this instance.
Definition: recv.h:14
__malloc char * daemon_get_uptime_str(const struct timeval *current_time)
Construct a string containing the current uptime.
Definition: daemon.c:431
int check_wav_post_monitor(struct check_wav_context *cwc)
Filter out the wav header, pushdown everything else.
Definition: check_wav.c:124
void flowopt_cleanup(struct flowopts *fo)
Deallocate all resources of a flowopts structure.
Definition: net.c:363
#define NOISE_TAB_SIZE
Definition: wmadec_filter.c:49
void mutex_unlock(int id)
Unlock a mutex.
Definition: ipc.c:94
#define WRITE_CMD_OPT_RESULT(_cmd, _opt, _lpr)
Definition: write.h:57
int para_regcomp(regex_t *preg, const char *regex, int cflags)
Compile a regular expression.
Definition: string.c:835
@ COLOR_SEPARATOR
Definition: gui.c:79
#define FOR_EACH_CHILD(_tn, _btrn)
Definition: buffer_tree.c:242
int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *diff)
Compute the difference of two time values.
Definition: time.c:42
@ MIN_AFHI_SIZE
Minimal on-disk size of a valid afhi struct.
Definition: aft.c:321
void mutex_lock(int id)
Lock the given mutex.
Definition: ipc.c:68
#define list_for_each_entry(pos, head, member)
Iterate over a list.
Definition: list.h:134
struct ringbuffer * ringbuffer_new(unsigned size)
Initialize a new ringbuffer.
Definition: ringbuffer.c:42
int write_all(int fd, const char *buf, size_t len)
Write to a file descriptor, fail on short writes.
Definition: fd.c:142
int string_compare(const struct osl_object *obj1, const struct osl_object *obj2)
Compare two osl objects of string type.
Definition: afs.c:351
void stdout_task_register(struct stdout_task *sot, struct sched *s)
Register a stdout task structure.
Definition: stdout.c:78
_static_inline_ int afs_max_size_handler(char *buf, size_t size, void *private)
Standard max_size handler for AFS commands.
Definition: afs.h:219
void btr_consume(struct btr_node *btrn, size_t numbytes)
Deallocate the given number of bytes from the input queue.
Definition: buffer_tree.c:737
struct queued_chunk * cq_peek(struct chunk_queue *cq)
Lookup the next chunk in the queue.
Definition: chunk_queue.c:71
#define RSA_PUBKEY_SEXP
S-expression for the public part of an RSA key.
Definition: gcrypt.c:109
__printf_3_4 int send_sb_va(struct stream_cipher_context *scc, int band, const char *fmt,...)
Create a variable sized buffer and send it as a sideband packet.
Definition: command.c:179
void oac_custom_header_flush(struct oac_custom_header *h)
Force remaining packets into an ogg page.
Definition: ogg_afh_common.c:412
int shm_size(int id, size_t *result)
Get the size of a shared memory segment.
Definition: ipc.c:169
int send_strerror(struct command_context *cc, int err)
Send an error message to a client.
Definition: command.c:200
__must_check int mark_fd_blocking(int fd)
Set a file descriptor to blocking mode.
Definition: fd.c:308
int mutex_new(void)
Define a new mutex.
Definition: ipc.c:23
@ CL_RECEIVED_WELCOME
Server sends the welcome message.
Definition: client.h:10
const struct receiver * receiver
Points to the corresponding receiver.
Definition: recv.h:10
#define INIT_BLOB_TABLE(table_name)
Define a blob table.
Definition: blob.c:76
__must_check void * arr_realloc(void *ptr, size_t nmemb, size_t size)
Reallocate an array, abort on failure or bugs.
Definition: string.c:33
size_t btr_pool_size(const struct btr_pool *btrp)
Return the size of the buffer pool area.
Definition: buffer_tree.c:106
__malloc char * get_time_string(void)
Compute the play time based on information of the current slot.
Definition: audiod.c:294
const char * version_single_line(const char *pfx)
Get the version string for an executable.
Definition: version.c:17
Structures and prototypes common to the speex audio format handler and the speex decoder.
__printf_2_3 unsigned xasprintf(char **result, const char *fmt,...)
Print to a dynamically allocated string, variable number of arguments.
Definition: string.c:213
void hash2_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash2 of the given input data.
Definition: gcrypt.c:49
const struct audio_format_handler flac_afh
The audio format handler for flac (free lossless audio decoder).
Definition: flac_afh.c:522
@ BLOB_RENAME
A blob was renamed.
Definition: afs.h:51
@ CAB_HASH_OFFSET
The hash of the audio file being added.
Definition: aft.c:1575
#define DCCP_SOCKOPT_GET_CUR_MPS
Max packet size, RFC 4340, 14.
Definition: dccp_send.c:97
int handle_connect(int fd)
Perform user authentication and execute a command.
Definition: command.c:920
char * mp_path(struct mp_context *ctx)
Return the full path to the audio file.
Definition: mp.c:285
@ LS_MODE_LONG
-l or -l=l
Definition: aft.c:71
int read_nonblock(int fd, void *buf, size_t sz, size_t *num_bytes)
Read from a non-blocking file descriptor into a single buffer.
Definition: fd.c:256
int spx_process_header(unsigned char *packet, long bytes, struct spx_header_info *shi)
Obtain information about a speex file from an ogg packet.
Definition: spx_common.c:83
int oac_get_file_info(char *map, size_t numbytes, struct afh_info *afhi, struct oac_callback_info *ci)
Pass first three ogg packets to callback and build the chunk table.
Definition: ogg_afh_common.c:121
@ BTR_NT_ROOT
Definition: buffer_tree.h:110
bool sb_sent(struct sb_context *c, size_t nbytes)
Update the sideband context after data has been sent.
Definition: sideband.c:160
@ COLOR_COMMAND
Definition: gui.c:75
int(* get)(struct mixer_handle *handle)
Return the (normalized) current value of the selected channel.
Definition: mix.h:31
int channels_arg
Number of channels, or the default value.
Definition: check_wav.h:15
char * parse_url(const char *url, char *host, ssize_t hostlen, int32_t *port)
Parse and validate URL string.
Definition: net.c:142
#define HANDSHAKE_BUFSIZE
Definition: command.c:841
int recv_buffer(int fd, char *buf, size_t size)
Receive and write terminating NULL byte.
Definition: net.c:794
uint8_t amp
Amplification value.
Definition: afs.h:20
#define RECEIVER(_a)
Definition: audiod.c:96
ssize_t send_cred_buffer(int sock, char *buf)
Send a buffer and the credentials of the current process to a socket.
Definition: net.c:1030
int(* line_handler)(char *line)
Complete input lines are passed to this callback function.
Definition: interactive.h:57
Callbacks provided by the user of the mp4 parsing API.
Definition: mp4.h:17
@ SENDER_add
Add a target (udp only).
Definition: send.h:27
void btr_log_tree(const struct btr_node *btrn, int loglevel)
Write the current buffer (sub-)tree to the log.
Definition: buffer_tree.c:1188
void version_handle_flag(const char *pfx, bool flag)
Print the version text and exit successfully.
Definition: version.c:63
int mood_check_callback(struct afs_callback_arg *aca)
Check all moods for syntax errors.
Definition: mood.c:216
void(* pre_monitor)(struct sched *s)
Ask the scheduler to monitor file descriptors.
Definition: send.h:81
int create_shifted_argv(const char *buf, const char *delim, char ***result)
Split a buffer into words, offset one.
Definition: string.c:819
void check_wav_shutdown(struct check_wav_context *cwc)
Dellocate all ressources of a check_wav instance.
Definition: check_wav.c:231
void sched_min_delay(struct sched *s)
Set the I/O timeout to the minimal possible value.
Definition: sched.c:359
void close_stat_clients(void)
Empty the status clients list.
Definition: audiod_command.c:128
void(* send_fec)(struct sender_client *sc, char *buf, size_t len)
Push out FEC-encoded packets.
Definition: send.h:165
#define PRIVATE_PEM_KEY_FOOTER
Private PEM keys (legacy format) end with this footer.
Definition: crypt_common.c:263
void i9e_complete_option(char **opts, struct i9e_completion_info *ci, struct i9e_completion_result *cr)
Complete according to the given options.
Definition: interactive.c:711
#define FOR_EACH_BUDDY_SAFE(_buddy, _tmp_buddy, _list)
Definition: sync_filter.c:51
void apc_free_pubkey(struct asymmetric_key *pub)
Deallocate a public key.
Definition: openssl.c:358
uint32_t mp4_num_samples(const struct mp4 *f)
Return the number of samples of the audio track.
Definition: mp4.c:823
afsi_offsets
Describes the layout of the mmapped-afs info struct.
Definition: aft.c:130
Bitstream structures and inline functions.
bool process_is_command_handler(void)
Tell whether the executing process is a command handler.
Definition: server.c:99
char * stat_item_values[NUM_STAT_ITEMS]
Dummy version which only contains NULL pointers.
Definition: filter.c:42
@ SBD_AWAITING_DATA
Definition: sideband.h:66
#define I9E_DUMMY_COMPLETER(name)
Define a completer which does nothing.
Definition: interactive.h:32
int aft_check_callback(struct afs_callback_arg *aca)
Check the audio file table for inconsistencies.
Definition: aft.c:2527
#define OPT_ADD(fo, lev, opt, val, len)
Flowopt shortcut.
Definition: dccp_recv.c:67
unsigned char bitnum
Its bit number.
Definition: afs.h:63
void * ringbuffer_get(struct ringbuffer *rb, int num)
Get one entry from a ringbuffer.
Definition: ringbuffer.c:83
int grab_client_new(int fd, struct lls_parse_result *lpr, struct sched *s)
Create and activate a grab client.
Definition: grab_client.c:261
struct para_buffer pbout
Will be written on band SBD_OUTPUT, fully buffered.
Definition: afs.h:159
Describes one instance of a receiver.
Definition: recv.h:8
int string_compare(const struct osl_object *obj1, const struct osl_object *obj2)
Compare two osl objects of string type.
Definition: afs.c:351
pattern_match_flags
Flags passed to for_each_matching_row().
Definition: afs.h:119
void hash2_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash2 of the given input data.
Definition: openssl.c:538
size_t shm_get_shmmax(void)
Get the maximal size of a shared memory area.
Definition: ipc.c:211
#define WRITE_STATUS_ITEM(b, n, f,...)
Write the contents of a status item to a para_buffer.
Definition: string.h:59
int mp_init(const char *definition, int nbytes, struct mp_context **result, char **errmsg)
Initialize the mood parser.
Definition: mp.c:507
struct gui_color_spec sep
Color for the separator line.
Definition: gui.h:56
char * word
The word the cursor is in.
Definition: interactive.h:10
void shutdown_clients(struct sender_status *ss)
Shut down all clients connected to a paraslash sender.
Definition: send_common.c:68
int mp_init(const char *definition, int nbytes, struct mp_context **result, char **errmsg)
Initialize the mood parser.
Definition: mp.c:507
void * btr_context(const struct btr_node *btrn)
Obtain the context of a buffer node tree.
Definition: buffer_tree.c:982
void btr_remove_node(struct btr_node **btrnp)
Remove a node from a buffer tree.
Definition: buffer_tree.c:817
void daemon_set_hooks(void(*pre_log_hook)(void), void(*post_log_hook)(void))
Register functions to be called before and after a message is logged.
Definition: daemon.c:184
int open_and_update_audio_file(int *fd)
Open the audio file with highest score and set up an afd structure.
Definition: aft.c:1043
int32_t afh_get_start_chunk(int32_t approx_chunk_num, const struct afh_info *afhi, uint8_t audio_format_id)
Find a suitable start chunk.
Definition: afh_common.c:313
long unsigned tv2ms(const struct timeval *tv)
Convert struct timeval to milliseconds.
Definition: time.c:13
char * key_value_copy(const char *src, size_t len, const char *key)
Copy the value of a key=value pair.
Definition: string.c:891
void del_close_on_fork_list(int fd)
Delete one file descriptor from the close-on-fork list.
Definition: close_on_fork.c:51
int oac_rewrite_tags(const char *map, size_t map_sz, int fd, char *meta_packet, size_t meta_sz)
Change meta tags of ogg files.
Definition: ogg_afh_common.c:225
struct btr_node * btrn
The buffer tree node associated with this writer node.
Definition: write.h:16
#define SOCK_DCCP
Linux socket type.
Definition: net.c:235
#define PARA_DEBUG_LOG(f,...)
Definition: para.h:217
void imdct_end(struct mdct_context *ctx)
Deallocate imdct resources.
Definition: imdct.c:399
const char * version_text(const char *pfx)
Get the full version text.
Definition: version.c:37
#define OPUSDEC_MAX_OUTPUT_SIZE
Definition: opusdec_filter.c:208
int(* packet_callback)(ogg_packet *packet, int packet_num, int serial, struct afh_info *afhi, void *private_data)
ogg_get_file_info() calls this function for the first three ogg packets, or until the callback return...
Definition: ogg_afh_common.h:32
void(* completer)(struct i9e_completion_info *, struct i9e_completion_result *)
The completer returns all possible completions via the second parameter.
Definition: interactive.h:44
int oac_custom_header_append(ogg_packet *op, struct oac_custom_header *h)
Submit an ogg packet to a custom header structure.
Definition: ogg_afh_common.c:397
void generic_com_allow(struct sender_command_data *scd, struct sender_status *ss)
Allow connections from the given range of IP addresses.
Definition: send_common.c:235
int handle_connect(int fd)
Perform user authentication and execute a command.
Definition: command.c:920
#define OPT_GIVEN(_cmd, _opt)
Definition: mixer.c:39
int client_connect(struct client_task *ct, struct sched *s, struct btr_node *parent, struct btr_node *child)
Connect to para_server and register the client task.
Definition: client_common.c:493
void(* send)(long unsigned current_chunk, long unsigned chunks_sent, const char *buf, size_t len, const char *header_buf, size_t header_len)
The send-hook.
Definition: send.h:77
time_t daemon_get_uptime(const struct timeval *current_time)
Get the uptime.
Definition: daemon.c:414
__printf_2_3 unsigned xasprintf(char **result, const char *fmt,...)
Print to a dynamically allocated string, variable number of arguments.
Definition: string.c:213
@ ATS_INITIAL
We haven't encountered an mp4a atom so far.
Definition: mp4.c:31
struct chunk_queue * cq
The list of pending chunks for this client.
Definition: send.h:128
int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr, int *loglevel)
Parse a client configuration.
Definition: client_common.c:561
int mmap_full_file(const char *path, int open_mode, void **map, size_t *size, int *fd_ptr)
Open a file and map it into memory.
Definition: fd.c:435
#define NUM_THEMES
Number of elements in the themes array.
Definition: gui_theme.c:369
@ NUM_AFT_COLUMNS
The number of columns of this table.
Definition: aft.c:213
int btr_node_status(const struct btr_node *btrn, size_t min_iqs, enum btr_node_type type)
Return the current state of a buffer tree node.
Definition: buffer_tree.c:1248
const char * prefix
Text to print before the item content.
Definition: gui.h:16
__must_check __malloc void * arr_zalloc(size_t nmemb, size_t size)
Allocate and initialize an array, abort on failure or bugs.
Definition: string.c:75
_static_inline_ void sc_trafo(struct iovec *src, struct iovec *dst, void *trafo_context)
Wrapper for sc_crypt() that can be used as a sideband transformation.
Definition: crypt.h:152
_static_inline_ long int para_random(unsigned max)
Return a random non-negative integer in an interval.
Definition: para.h:110
@ ATOM_ITEMS
Definition: mp4.c:164
int pass_buffer_as_shm(int fd, uint8_t band, const char *buf, size_t size)
Send data as shared memory to a file descriptor.
Definition: afs.c:688
#define DCCP_MAX_HOST_CCIDS
Functions and definitions to support IPPROTO_DCCP.
Definition: net.h:81
void btr_merge(struct btr_node *btrn, size_t dest_size)
Combine input queue buffers.
Definition: buffer_tree.c:1147
int mmd_mutex
The mutex protecting the shared memory area containing the mmd struct.
Definition: server.c:77
#define ENDIAN
Determine byte sex.
Definition: oggdec_filter.c:20
int(* btr_command_handler)(const struct btr_node *btrn, const char *command, char **result)
Per node handler used for inter node communication.
Definition: buffer_tree.h:132
shm_attach_mode
possible values for shm_attach()
Definition: ipc.h:4
void get_random_bytes_or_die(unsigned char *buf, int num)
Fill a buffer with random content.
Definition: openssl.c:36
The tags used by all audio format handlers.
Definition: afh.h:11
#define OPT_RESULT(_name, _lpr)
Definition: write.c:27
@ AFSI_CHANGE
The afs info struct of an audio file changed.
Definition: afs.h:39
@ AFSI_AUDIO_FORMAT_ID_OFFSET
Storage position of the .audio_format_id field.
Definition: aft.c:142
@ AFSI_NUM_PLAYED_OFFSET
Storage position of the .num_played field.
Definition: aft.c:136
void ms2tv(long unsigned n, struct timeval *tv)
Convert milliseconds to a struct timeval.
Definition: time.c:24
int get_afhi_of_row(const struct osl_row *row, struct afh_info *afhi)
Get the audio format handler info, given a row of the audio file table.
Definition: aft.c:590
Parsed regex pattern.
Definition: mp.h:27
void print_receiver_helps(bool detailed)
Print out the help texts to all receivers.
Definition: recv_common.c:80
void shutdown_clients(struct sender_status *ss)
Shut down all clients connected to a paraslash sender.
Definition: send_common.c:68
struct task * task
The task of this writer node.
Definition: write.h:18
__printf_2_3 void afs_error(const struct afs_callback_arg *aca, const char *fmt,...)
Format and send an error message to the command handler.
Definition: afs.c:739
#define IS_LLS_ERROR(num)
Check whether the lopsub error bit is set.
Definition: error.h:271
int grab_client_new(int fd, struct lls_parse_result *lpr, struct sched *s)
Create and activate a grab client.
Definition: grab_client.c:261
#define WRITE_CMD_OPT_STRING_VAL(_cmd, _opt, _lpr)
Definition: write.h:63
void hash2_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash2 of the given input data.
Definition: gcrypt.c:49
void score_clear(void)
Remove all entries from the score table, but keep the table open.
Definition: score.c:319
@ SBD_CHALLENGE_RESPONSE
Definition: sideband.h:66
@ CAB_PATH_OFFSET
Start of the path of the audio file.
Definition: aft.c:1577
int tv_convex_combination(const long a, const struct timeval *tv1, const long b, const struct timeval *tv2, struct timeval *result)
Compute a convex combination of two time values.
Definition: time.c:130
void clear_and_dump_items(void)
Flush and send all status items.
Definition: audiod_command.c:496
__printf_2_3 void(* para_log)(int, const char *,...)
The log function of para_gui, always set to curses_log().
Definition: mixer.c:64
Methods for table startup/shutdown and event handling.
Definition: afs.h:77
#define SB_DESIGNATORS
The valid sideband designators.
Definition: sideband.h:24
#define OPT_RESULT(_name)
Definition: audiod.c:43
struct mp4_metadata * mp4_get_meta(struct mp4 *f)
Return the metadata of an mp4 file.
Definition: mp4.c:868
int generic_recv_pre_monitor(struct sched *s, struct receiver_node *rn)
Request a minimal timeout in case of buffer tree errors.
Definition: recv_common.c:113
int(* audiod_cmd_handler_t)(int, struct lls_parse_result *)
Pointer to a command handler function.
Definition: audiod_command.c:39
int mp4_set_sample_position(struct mp4 *f, uint32_t sample)
Reposition the read/write file offset.
Definition: mp4.c:734
@ AFSI_AMP_OFFSET
Storage position of the amplification field.
Definition: aft.c:144
#define OPT_UINT32_VAL(_name)
Definition: gui.c:35
int fd_flags
The descriptor flags of STDIN at startup.
Definition: stdin.h:14
#define PARA_NOTICE_LOG(f,...)
Definition: para.h:219
void score_close(struct osl_table *t)
Free all volatile objects, then close the table.
Definition: score.c:284
void btr_add_output_dont_free(const char *buf, size_t size, struct btr_node *btrn)
Insert a buffer into the buffer tree, non-freeing variant.
Definition: buffer_tree.c:439
char ** i9e_complete_commands(const char *word, struct i9e_completer *completers)
Return the list of partially matching words.
Definition: interactive.c:670
@ FEC_STATE_READY_TO_RUN
initialized and enabled
Definition: vss.c:126
#define UDP_MAX_UNREACHABLE_TIME
Time window during which ICMP Destination/Port Unreachable messages are ignored, covering transient r...
Definition: udp_send.c:36
@ SBD_ANY
Definition: sideband.h:66
off_t(* seek)(void *user_data, off_t offset, int whence)
This method is assumed to succeed.
Definition: mp4.h:30
const struct filter lsg_filter_cmd_com_flacdec_user_data
Definition: flacdec_filter.c:294
void sched_monitor_writefd(int fd, struct sched *s)
Instruct the scheduler to monitor an fd for readiness for writing.
Definition: sched.c:512
void i9e_print_status_bar(char *buf, unsigned len)
Print the current status to stderr.
Definition: interactive.c:551
@ FELF_READ_ONLY
Activate read-only mode.
Definition: string.h:40
unsigned int vss_next(void)
Check if the N (next) status flag is set.
Definition: vss.c:759
char host[MAX_HOSTLEN]
Used for the allow/deny/add/remove subcommands.
Definition: server.h:15
#define PKT_PEM
Legacy PEM keys (openssh-7.7 and earlier, paraslash.0.6.2 and earlier)
Definition: crypt_backend.h:15
int send_afs_status(struct command_context *cc, int parser_friendly)
Get the current afs status items from the afs process and send it.
Definition: aft.c:2477
@ DF_LOG_TIMING
Include milliseconds in log output.
Definition: daemon.h:36
int audiod_status
The current mode of operation (AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY).
Definition: audiod.c:167
@ CHUNKS_TOTAL_OFFSET
The total number of chunks (4 bytes).
Definition: aft.c:307
int fec_decode(struct fec_parms *parms, unsigned char **data, int *idx, int sz)
Decode one slice from the group of received slices.
Definition: fec.c:597
afs_socket_status
The possible states of the afs socket.
Definition: vss.c:43
int para_open(const char *path, int flags, mode_t mode)
Wrapper for the open(2) system call.
Definition: fd.c:380
int mood_load(const char *mood_name, struct mood_instance **result, char **msg)
Populate a score table with admissible files for the given mood.
Definition: mood.c:623
int shm_new(size_t size)
Create a new shared memory area of given size.
Definition: ipc.c:116
char ** features
List of features supported by the server.
Definition: client.h:46
#define HIGH_BAND_MAX_SIZE
Definition: wmadec_filter.c:42
int decode_private_key(const char *key_file, unsigned char **result, size_t *blob_size)
Decode an openssh-v1 (aka RFC4716) or PEM (aka ASN.1) private key.
Definition: crypt_common.c:280
#define MAD_TO_SHORT(f)
Convert a sample value from libmad to a signed short.
Definition: mp3dec_filter.c:19
Exported functions from color.c.
struct iovec iov
Data and length.
Definition: sideband.h:83
int recv_sb(struct stream_cipher_context *scc, enum sb_designator expected_band, size_t max_size, struct iovec *result)
Receive a sideband packet from a blocking file descriptor.
Definition: command.c:294
void btr_pushdown_one(struct btr_node *btrn)
Feed the next buffer of the input queue through the output channel.
Definition: buffer_tree.c:548
int(* event_handler)(enum afs_events event, struct para_buffer *pb, void *data)
Handle events generated by other tables.
Definition: afs.h:85
int para_mmap(size_t length, int prot, int flags, int fd, void *map)
Paraslash's wrapper for mmap.
Definition: fd.c:351
#define U32_OPTVAL(_opt, _lpr)
Definition: compress_filter.c:21
@ AFTCOL_HASH
The hash on the content of the audio file.
Definition: upgrade_db.c:116
char * comment
COMM/COMMENT/cmt.
Definition: afh.h:21
void * btr_context(const struct btr_node *btrn)
Obtain the context of a buffer node tree.
Definition: buffer_tree.c:982
#define FOR_EACH_SLOT(_slot)
Iterate over all slots.
Definition: audiod.c:102
struct gui_color_spec err_msg
Color for severe log messages.
Definition: gui.h:54
int sb_get_send_buffers(struct sb_context *c, struct iovec iov[2])
Obtain pointer(s) to the sideband send buffer(s).
Definition: sideband.c:127
unsigned parse_quoted_string(const char *src, const char quote_chars[2], char **result)
Parse a (generalized) string literal.
Definition: mp.c:84
struct timeval * clock_get_realtime(struct timeval *tv)
Retrieve the time of the realtime clock.
Definition: time.c:194
struct sender_client * accept_sender_client(struct sender_status *ss)
Accept a connection on the socket(s) this server is listening on.
Definition: send_common.c:369
@ NUM_LOGLEVELS
Definition: para.h:215
const struct sender udp_sender
The UDP sender.
Definition: udp_send.c:448
unsigned len
Item width, including prefix and postfix.
Definition: gui.h:20
int mmd_mutex
The mutex protecting the shared memory area containing the mmd struct.
Definition: server.c:77
void btr_add_output(char *buf, size_t size, struct btr_node *btrn)
Insert a malloced buffer into the buffer tree.
Definition: buffer_tree.c:409
@ GM_PEDANTIC
Close fd if write would block.
Definition: grab_client.c:30
@ VSS_STATUS_FLAG_PLAYING
The 'P' flag is set.
Definition: audiod.c:116
audio_track_state
The three states of the mp4 parser.
Definition: mp4.c:29
#define WMA_OUTPUT_BUFFER_SIZE
Definition: wmadec_filter.c:1160
const struct filter lsg_filter_cmd_com_aacdec_user_data
Definition: aacdec_filter.c:159
void * private_data
Data specific to the particular sender.
Definition: send.h:130
int for_each_line(unsigned flags, char *buf, size_t size, line_handler_t *line_handler, void *private_data)
Call a custom function for each complete line.
Definition: string.c:382
int uudecode(char const *src, size_t encoded_size, char **result, size_t *decoded_size)
Decode a buffer using the uuencode Base64 algorithm.
Definition: base64.c:191
__a_const int wma_log2(unsigned int v)
Compute the base-2 logarithm.
Definition: wma_common.c:166
#define NUM_INTERNALLY_MAPPED_KEYS
Definition: play.c:531
void clear_afhi(struct afh_info *afhi)
Deallocate the contents of an afh_info structure.
Definition: afh_common.c:209
int i9e_get_error(void)
Return the error state of the i9e task.
Definition: interactive.c:50
bool must_set_nonblock_flag
Whether we have to set STDIN to nonblocking mode.
Definition: stdin.h:16
int sb_received(struct sb_context *c, size_t nbytes, struct sb_buffer *result)
Update the sideband context after data has been received.
Definition: sideband.c:213
struct queued_chunk * cq_peek(struct chunk_queue *cq)
Lookup the next chunk in the queue.
Definition: chunk_queue.c:71
int btr_node_status(const struct btr_node *btrn, size_t min_iqs, enum btr_node_type type)
Return the current state of a buffer tree node.
Definition: buffer_tree.c:1248
int xpoll(struct pollfd *fds, nfds_t nfds, int timeout)
Simple wrapper for poll(2).
Definition: fd.c:519
#define SBB_INIT(_band, _buf, _numbytes)
Initialize a sideband buffer.
Definition: sideband.h:115
int(* create)(const char *)
Called from the init command.
Definition: afs.h:83
void * private_data
Writer-specific data.
Definition: write.h:12
int para_next_signal(void)
Return the number of the next pending signal.
Definition: signal.c:212
symbols used by gui and gui_theme
@ LOGLEVELS
Definition: para.h:215
#define CMUL(pre, pim, are, aim, bre, bim)
Definition: imdct.c:248
int fd
Local socket connecting the command handler and the AFS process.
Definition: afs.h:199
void score_open(struct osl_table **result)
Allocate a score table instance.
Definition: score.c:308
void cq_dequeue(struct chunk_queue *cq)
Remove the current chunk from the queue.
Definition: chunk_queue.c:83
void get_random_bytes_or_die(unsigned char *buf, int num)
Fill a buffer with random content.
Definition: gcrypt.c:65
struct mp4_metadata * mp4_get_meta(struct mp4 *f)
Return the metadata of an mp4 file.
Definition: mp4.c:868
__malloc char * format_url(const char *url, int default_port)
Pretty-print a host/port pair.
Definition: net.c:193
void mutex_lock(int id)
Lock the given mutex.
Definition: ipc.c:68
size_t vss_get_fec_eof_packet(const char **buf)
Return a buffer that marks the end of the stream.
Definition: vss.c:656
struct timeval chunk_tv
Period of time between sending data chunks.
Definition: afh.h:42
struct ringbuffer * ringbuffer_new(unsigned size)
Initialize a new ringbuffer.
Definition: ringbuffer.c:42
int create_local_socket(const char *name)
Create a socket for local communication and listen on it.
Definition: net.c:938
int sample_format_given
Whether the sample format was given.
Definition: check_wav.h:25
char * buf
The buffer.
Definition: string.h:14
void task_notify_all(struct sched *s, int err)
Set the notification value of all tasks of a scheduler instance.
Definition: sched.c:344
#define list_for_each_entry_safe(pos, n, head, member)
Iterate over list, safe against removal of list entry.
Definition: list.h:147
How to display one status item.
Definition: gui.h:15
int align
How to align this item.
Definition: gui.h:22
#define PARA_ERROR_LOG(f,...)
Definition: para.h:221
void free_argv(char **argv)
Free an array of words created by create_argv() or create_shifted_argv().
Definition: string.c:745
exported functions from user_list.c
int mutex_new(void)
Define a new mutex.
Definition: ipc.c:23
@ LS_MODE_MBOX
-l=v
Definition: aft.c:73
int table_size
The size of the table.
Definition: bitstream.h:28
btr_command_handler handler
Used for inter node communication.
Definition: buffer_tree.h:162
void cq_destroy(struct chunk_queue *cq)
Deallocate all resources of this queue.
Definition: chunk_queue.c:145
char * user
Paraslash user name.
Definition: client.h:42
@ AFTCOL_PATH
The full path in the filesystem.
Definition: upgrade_db.c:118
__must_check int afs_event(enum afs_events event, struct para_buffer *pb, void *data)
The afs event dispatcher.
Definition: afs.c:1133
#define PARA_EMERG_LOG(f,...)
Definition: para.h:223
__must_check void * arr_realloc(void *ptr, size_t nmemb, size_t size)
Reallocate an array, abort on failure or bugs.
Definition: string.c:33
void user_list_deplete(void)
Remove all entries from the user list.
Definition: user_list.c:48
asn1_types
ASN Types and their code.
Definition: gcrypt.c:126
__printf_2_3 int para_printf(struct para_buffer *b, const char *fmt,...)
Safely print into a buffer at a given offset.
Definition: string.c:505
struct lls_parse_result * lpr
Obtained by deserializing the query buffer in the callback.
Definition: afs.h:141
int status
The state of the connection.
Definition: client.h:28
size_t btr_pool_unused(const struct btr_pool *btrp)
Get the number of unused bytes in the buffer pool.
Definition: buffer_tree.c:132
__printf_2_3 int write_va_buffer(int fd, const char *fmt,...)
A fprintf-like function for raw file descriptors.
Definition: fd.c:169
__must_check __malloc void * alloc(size_t size)
Paraslash's version of malloc().
Definition: string.c:133
#define NUM_AUDIO_FORMATS
Definition: audiod.c:51
Describes one running instance of a filter.
Definition: filter.h:8
int check_private_key_file(const char *file)
Check existence and permissions of a private key file.
Definition: crypt_common.c:127
bool boolval
Comparators, =~ and =|.
Definition: mp.h:51
void get_attribute_bitmap(const uint64_t *atts, char *buf)
Return a binary representation of the given attribute value.
Definition: attribute.c:365
int header_sent
Non-zero if audio file header has been sent.
Definition: send.h:126
@ LS_SORT_BY_PATH
-s=p (default)
Definition: aft.c:54
void acl_deny(char *addr, int mask, struct list_head *acl, int default_deny)
Deny access for a range of IP addresses.
Definition: acl.c:187
void daemon_set_start_time(void)
Set the startup time.
Definition: daemon.c:397
struct gui_color_spec msg
Color for log messages of moderate severity.
Definition: gui.h:52
void btr_get_node_start(const struct btr_node *btrn, struct timeval *tv)
Get the time of the first I/O for a buffer tree node.
Definition: buffer_tree.c:1273
void daemon_set_logfile(const char *logfile_name)
Init or change the name of the log file.
Definition: daemon.c:129
#define OGGDEC_OUTPUT_CHUNK_SIZE
Allocate chunks of this size and produce at most one chunk of output per ->post_monitor() invocation.
Definition: oggdec_filter.c:186
#define MIN_STAT_ITEM_LEN
The minimal length of a status item buffer.
Definition: stat.c:16
unsigned x
Horizontal start coordinate for this item.
Definition: gui.h:18
#define RIGHT
Status item text should be right-aligned.
Definition: gui.h:66
@ HTTP_GOT_GET_REQUEST
Successfully received the get request.
Definition: http_send.c:38
int get_attribute_bitnum_by_name(const char *att_name, unsigned char *bitnum)
Retrieve the identifier (number) of an attribute.
Definition: attribute.c:91
void daemon_set_flag(unsigned flag)
Set one of the daemon config flags.
Definition: daemon.c:197
Specifies one metadata tag.
Definition: mp4.h:46
void i9e_ll_completer(struct i9e_completion_info *ci, struct i9e_completion_result *cr)
Complete on severity strings.
Definition: interactive.c:809
struct check_wav_context * check_wav_init(struct btr_node *parent, struct btr_node *child, struct wav_params *params, struct btr_node **cw_btrn)
Allocate and set up a new check_wav instance.
Definition: check_wav.c:206
char * buffer
The full line.
Definition: interactive.h:9
int read_asf_header(const char *buf, int loaded, struct asf_header_info *ahi)
Read an asf audio file header.
Definition: wma_common.c:87
void check_wav_shutdown(struct check_wav_context *cwc)
Dellocate all ressources of a check_wav instance.
Definition: check_wav.c:231
#define FILTER_CMD_OPT_UINT32_VAL(_cmd, _opt, _lpr)
Definition: filter.h:110
Doubly linked list implementation.
Information that must be supplied by callers of task_register().
Definition: sched.h:41
void theme_next(struct gui_theme *t)
Activate the next available theme.
Definition: gui_theme.c:431
int uudecode(char const *src, size_t encoded_size, char **result, size_t *decoded_size)
Decode a buffer using the uuencode Base64 algorithm.
Definition: base64.c:191
void(* post_monitor)(struct sched *s)
Perform I/O on the file descriptors which are ready.
Definition: send.h:83
const char * postfix
Text to print after item content.
Definition: gui.h:17
@ ATTCOL_NAME
The name of the attribute.
Definition: attribute.c:28
int imdct_init(int nbits, struct mdct_context **result)
Initialize the inverse modified cosine transform.
Definition: imdct.c:363
int create_argv(const char *buf, const char *delim, char ***result)
Split a buffer into words.
Definition: string.c:800
state_change_request_type
Describes a request to change the state of para_play.
Definition: play.c:49
bool process_is_command_handler(void)
Tell whether the executing process is a command handler.
Definition: server.c:99
@ SENDER_delete
Delete a target (udp only).
Definition: send.h:27
ssize_t(* write)(void *user_data, void *buffer, size_t count)
Like the write() system call, this should return the number of bytes written.
Definition: mp4.h:36
int read_and_compare(int fd, const char *expectation)
Read a buffer and compare its contents to a string, ignoring case.
Definition: fd.c:278
struct pollfd * pfd
Passed to poll(2).
Definition: sched.h:23
@ CAB_AFHI_OFFSET_POS
Definition: aft.c:1567
char * strval
String literals, tags, path.
Definition: mp.h:52
char * get_task_list(struct sched *s)
Get the list of all registered tasks.
Definition: sched.c:255
struct osl_object query
Callback-specific data.
Definition: afs.h:157
@ HTTP_CONNECTED
Definition: http_recv.c:31
char * title
TIT2/TITLE/nam.
Definition: afh.h:15
const struct filter lsg_filter_cmd_com_oggdec_user_data
Definition: oggdec_filter.c:263
@ BLOBCOL_ID
The identifier, a positive integer that never repeats.
Definition: afs.h:312
int hash2_compare(const unsigned char *h1, const unsigned char *h2)
Compare two version 2 hashes.
Definition: crypt_common.c:175
int client_open(int argc, char *argv[], struct client_task **ct_ptr, int *loglevel, struct btr_node *parent, struct btr_node *child, struct sched *sched)
Parse the client configuration and open a connection to para_server.
Definition: client_common.c:637
struct asymmetric_key * pubkey
The public key.
Definition: user_list.h:30
Common server data structures.
@ CL_SENDING
Server is expecting data (addblob commands only).
Definition: client.h:22
Parsed wildcard pattern.
Definition: mp.h:33
int sample_rate_arg
Same semantics as channels_count.
Definition: check_wav.h:19
int fd
The file descriptor to receive the stream.
Definition: recv.h:33
struct btr_node * btr_search_node(const char *name, struct btr_node *root)
Find the node with the given name in the buffer tree.
Definition: buffer_tree.c:1203
@ CL_SENT_CH_RESPONSE
Client solves the challenge and sends the result.
Definition: client.h:16
exported symbols from net.c
#define LLS_COPY_WAV_PARMS(_dst, _pfx, _lpr)
Definition: check_wav.h:28
uint32_t afs_socket_cookie
A random number used to "authenticate" the afs connection.
Definition: server.c:74
char *(* help)(void)
Return the help text of this sender.
Definition: send.h:60
#define PARA_MIN(x, y)
Compute the minimum of x and y.
Definition: para.h:31
int shm_destroy(int id)
Destroy the given shared memory area.
Definition: ipc.c:132
void generic_filter_pre_monitor(struct sched *s, void *context)
Request a minimal timeout if not idle.
Definition: filter_common.c:181
int create_local_socket(const char *name)
Create a socket for local communication and listen on it.
Definition: net.c:938
void tv_divide(const unsigned long divisor, const struct timeval *tv, struct timeval *result)
Compute a fraction of given struct timeval.
Definition: time.c:107
#define MP_AFHI(_name)
Define a function which returns a field of the afh_info structure.
Definition: mp.c:378
bool row_belongs_to_score_table(const struct osl_row *aft_row)
Find out whether an audio file is contained in the score table.
Definition: score.c:266
char * safe_strdup(const char *src, size_t len)
strdup() for not necessarily zero-terminated strings.
Definition: string.c:865
int hash2_compare(const unsigned char *h1, const unsigned char *h2)
Compare two version 2 hashes.
Definition: crypt_common.c:175
#define CMD_PTR
Definition: write.c:26
@ COLOR_OUTPUT
Definition: gui.c:76
__malloc char * mp4_get_tag_value(const struct mp4 *f, const char *item)
Return the value of the given tag item.
Definition: mp4.c:1050
const char * version_text(const char *pfx)
Get the full version text.
Definition: version.c:37
#define BASE64_MAX_DECODED_SIZE(_encoded_size)
Maximal possible size of the decoded data.
Definition: base64.c:52
int * listen_fds
The socket fd(s) this sender is listening on.
Definition: send.h:177
int xrename(const char *oldpath, const char *newpath)
Change the name or location of a file.
Definition: fd.c:28
int score_add(const struct osl_row *aft_row, long score, struct osl_table *t)
Add a (row, score) pair to the score table.
Definition: score.c:99
int(* play_cmd_handler_t)(struct lls_parse_result *lpr)
Definition: play.c:100
void flowopt_add(struct flowopts *fo, int lev, int opt, const char *name, const void *val, int len)
Append new socket option to flowopt queue.
Definition: net.c:318
const char * filter_name(int filter_num)
Return the name of a filter, given its number.
Definition: filter_common.c:52
const struct afs_table_operations score_ops
The score table stores (aft row, score) pairs in memory.
Definition: score.c:326
Mixer API for para_mixer.
http_client_status
The possible states of a client from the server's POV.
Definition: http_send.c:34
uint32_t chunks_total
The number of chunks this audio file contains.
Definition: afh.h:27
size_t btr_pool_get_buffer(const struct btr_pool *btrp, char **result)
Obtain the current write head.
Definition: buffer_tree.c:159
time_t daemon_get_uptime(const struct timeval *current_time)
Get the uptime.
Definition: daemon.c:414
int64_t mp_year(struct mp_context *ctx)
Parse and return the value of the year tag.
Definition: mp.c:447
#define OPUS_COMMENT_HEADER
Definition: opus_afh.c:18
void daemon_log_welcome(const char *whoami)
Log the startup message containing the paraslash version.
Definition: daemon.c:315
@ AFSI_LAST_PLAYED_OFFSET
Where .last_played is stored.
Definition: aft.c:132
@ DF_LOG_PID
Whether the PID should be logged.
Definition: daemon.h:28
#define CENTER
Status item text should be displayed centered.
Definition: gui.h:68
__must_check int sanitize_str(const char *src, size_t max_width, char **result, size_t *width)
Truncate and sanitize a (wide character) string.
Definition: string.c:1055
@ AFTCOL_CHUNKS
The chunk table info and the chunk table of the audio file.
Definition: aft.c:211
const struct afs_table_operations attr_ops
The attribute table stores name/bitnum pairs.
Definition: attribute.c:494
int readv_nonblock(int fd, struct iovec *iov, int iovcnt, size_t *num_bytes)
Read from a non-blocking file descriptor into multiple buffers.
Definition: fd.c:207
__printf_2_3 void(* para_log)(int, const char *,...)
The log function of para_gui, always set to curses_log().
Definition: server.c:43
Receiver-related structures and exported symbols of recv_common.c.
struct btr_node * parent
Parent of the new node.
Definition: buffer_tree.h:158
int main(int argc, char *argv[])
The main function of para_gui.
Definition: gui.c:1482
void color_parse_or_die(const char *value, char *dst)
Create an escape sequence for colored output.
Definition: color.c:52
struct osl_row * aft_row
Pointer to the row that has changed.
Definition: afs.h:71
void stat_client_write_item(int item_num)
Write a message to all connected status clients.
Definition: audiod_command.c:145
#define RECV_CMD_OPT_INT32_VAL(_recv, _opt, _lpr)
Definition: recv.h:91
int cq_get(struct queued_chunk *qc, const char **buf, size_t *len)
Get a pointer to the given queued chunk.
Definition: chunk_queue.c:117
int dccp_available_ccids(uint8_t **ccid_array)
Probe the list of DCCP CCIDs configured on this host.
Definition: net.c:851
#define SIDEBAND_HEADER_SIZE
Each sideband packet consists of a header and a data part.
Definition: sideband.c:14
int hash_compare(const unsigned char *h1, const unsigned char *h2)
Compare two hashes.
Definition: crypt_common.c:150
#define do_nothing
A nice cup of STFU for Mr gcc.
Definition: para.h:185
#define AFH_RECV
Definition: play.c:116
struct stream_cipher_context scc
The file descriptor and the session keys.
Definition: client.h:30
int sample_rate_given
Whether the sample rate was given.
Definition: check_wav.h:21
const struct sender *const senders[]
NULL-terminated list, defined in vss.c.
Definition: vss.c:39
int opus_parse_header(const char *packet, int len, struct opus_header *h)
Get metadata of an opus stream.
Definition: opus_common.c:84
atom
The enumeration of interesting atoms.
Definition: mp4.c:164
The i9e configuration settings of the client.
Definition: interactive.h:53
int get_attribute_bitnum_by_name(const char *att_name, unsigned char *bitnum)
Retrieve the identifier (number) of an attribute.
Definition: attribute.c:91
struct fec_client * vss_add_fec_client(struct sender_client *sc, struct fec_client_parms *fcp)
Add one entry to the list of active fec clients.
Definition: vss.c:671
int client_open(int argc, char *argv[], struct client_task **ct_ptr, int *loglevel, struct btr_node *parent, struct btr_node *child, struct sched *sched)
Parse the client configuration and open a connection to para_server.
Definition: client_common.c:637
__must_check int mark_fd_nonblocking(int fd)
Set a file descriptor to non-blocking mode.
Definition: fd.c:326
@ CRT_REPOS
Stream must be repositioned (com_jmp(), com_ff()).
Definition: play.c:53
void hash_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash of the given input data.
Definition: openssl.c:523
#define OPT_RESULT(_name)
Definition: gui.c:32
Writer-related structures.
regex_t preg
Pre-compiled regex.
Definition: mp.h:28
size_t max_size
The maximal size this buffer may grow.
Definition: string.h:18
Each paraslash sender may register arbitrary many clients to the virtual streaming system,...
Definition: send.h:145
const struct filter lsg_filter_cmd_com_fecdec_user_data
Definition: fecdec_filter.c:479
@ SCORECOL_AFT_ROW
The row of the audio file.
Definition: score.c:48
int mp4_set_sample_position(struct mp4 *f, uint32_t sample)
Reposition the read/write file offset.
Definition: mp4.c:734
const struct user * user_list_lookup(const char *name)
Lookup a user in the user list.
Definition: user_list.c:152
int id
Corresponds to a token type, for example LESS_OR_EQUAL.
Definition: mp.h:72
#define CMD_PTR(_cmd)
Definition: mixer.c:36
const struct audio_format_handler mp3_afh
The mp3 audio format handler.
Definition: mp3_afh.c:684
void freep(void *arg)
Free the content of a pointer and set it to NULL.
Definition: string.c:258
@ CL_CONNECTED
TCP connection is established.
Definition: client.h:8
const uint8_t * buffer
Start of the internal buffer.
Definition: bitstream.h:14
#define MAX_CODED_SUPERFRAME_SIZE
Definition: wmadec_filter.c:45
int para_regcomp(regex_t *preg, const char *regex, int cflags)
Compile a regular expression.
Definition: string.c:835
int for_each_matching_row(struct pattern_match_data *pmd)
Execute the given function for each matching row.
Definition: afs.c:327
int bg
Background color.
Definition: gui.h:11
void cq_update(struct chunk_queue *cq, size_t sent)
Change the number of bytes sent for the current queued chunk.
Definition: chunk_queue.c:99
int spx_process_header(unsigned char *packet, long bytes, struct spx_header_info *shi)
Obtain information about a speex file from an ogg packet.
Definition: spx_common.c:83
void fec_encode(struct fec_parms *parms, const unsigned char *const *src, unsigned char *dst, int idx, int sz)
Compute one encoded slice of the given input.
Definition: fec.c:516
void para_block_signal(int sig)
Block a signal for the caller.
Definition: signal.c:175
void btr_splice_out_node(struct btr_node **btrnp)
Remove a node from the buffer tree, reconnecting parent and children.
Definition: buffer_tree.c:893
int get_score_and_aft_row(struct osl_row *score_row, long *score, struct osl_row **aft_row)
Given an admissible file, get the corresponding row in the aft and the score.
Definition: score.c:176
void generic_com_allow(struct sender_command_data *scd, struct sender_status *ss)
Allow connections from the given range of IP addresses.
Definition: send_common.c:235
void stat_client_write_item(int item_num)
Write a message to all connected status clients.
Definition: audiod_command.c:145
void imdct(struct mdct_context *s, float *output, const float *input)
Compute the inverse MDCT.
Definition: imdct.c:315
size_t min_iqs
The minimal input queue size (size of one audio sample).
Definition: write.h:20
@ GM_AGGRESSIVE
Write anyway (default).
Definition: grab_client.c:28
A completer is simply a function pointer and name of the command for which it performs completion.
Definition: interactive.h:40
char * safe_strdup(const char *src, size_t len)
strdup() for not necessarily zero-terminated strings.
Definition: string.c:865
void stdout_task_register(struct stdout_task *sot, struct sched *s)
Register a stdout task structure.
Definition: stdout.c:78
@ AFS_READ
None of the below.
Definition: user_list.h:15
#define FILTER_CMD_OPT_GIVEN(_cmd, _opt, _lpr)
Definition: filter.h:108
void free_status_items(void)
Deallocate and invalidate the status item strings.
Definition: aft.c:980
void acl_deny(char *addr, int netmask, struct list_head *acl, int default_deny)
Deny access for a range of IP addresses.
Definition: acl.c:187
void(* shutdown_clients)(void)
Terminate all connected clients.
Definition: send.h:90
unsigned int vss_next(void)
Check if the N (next) status flag is set.
Definition: vss.c:759
void print_filter_helps(bool detailed)
Print help text of each filter to stdout.
Definition: filter_common.c:121
char ** matches
NULL-terminated array of possible completions.
Definition: interactive.h:20
#define SYSTEM_ERROR_BIT
para_error
Definition: error.h:256
bool sched_write_ok(int fd, const struct sched *s)
Check whether writing is possible (i.e., does not block).
Definition: sched.c:560
#define CLIENT_OPT_STRING_VAL(_name, _lpr)
Definition: client.h:56
__printf_3_4 int send_sb_va(struct stream_cipher_context *scc, int band, const char *fmt,...)
Create a variable sized buffer and send it as a sideband packet.
Definition: command.c:179
#define OPT_UINT32_VAL(_name, _lpr)
Definition: upgrade_db.c:21
@ GF_ONE_SHOT
Stop grabbing if audio file changes.
Definition: grab_client.c:36
@ CAB_CHUNKS_OFFSET_POS
Start of the chunk table (if present).
Definition: aft.c:1569
void mp4_close(struct mp4 *f)
Deallocate all resources associated with an mp4 file handle.
Definition: mp4.c:593
#define HTTP_GET_MSG
sent by the connecting http client (http_recv, xmms, ...)
Definition: http.h:7
http_recv_status
the possible states of a http receiver node
Definition: http_recv.c:31
macros used by http_send and http_recv
Common client functions and exported symbols from client_common.c.
#define list_last_entry(ptr, type, member)
Definition: list.h:164
#define MAX_FRAME_SIZE
Size of the output buffer.
Definition: spxdec_filter.c:131
char * acl_get_contents(struct list_head *acl)
Compute a string containing the contents of an acl.
Definition: acl.c:130
#define MAP_POPULATE
As of 2018, neither FreeBSD-11.2 nor NetBSD-8.0 have MAP_POPULATE.
Definition: vss.c:950
int(* open)(const char *dev, struct mixer_handle **handle)
Return a handle that can be passed to other methods.
Definition: mix.h:24
void oac_custom_header_init(int serial, struct oac_custom_header *h)
Set the serial number of an allocated header structure.
Definition: ogg_afh_common.c:381
@ AFTCOL_AFHI
The audio format handler info.
Definition: aft.c:209
btr_command_handler execute
Answer a buffer tree query.
Definition: filter.h:96
const char * audio_format_name(int i)
audio_format_handler
Definition: afh_common.c:56
char * stat_item_values[NUM_STAT_ITEMS]
The array of status items sent by para_server.
Definition: audiod.c:161
int send_callback_request(afs_callback *f, struct osl_object *query, callback_result_handler *result_handler, void *private_result_data)
Ask the afs process to call a given function.
Definition: afs.c:173
#define OPT_UINT32_VAL(_cmd, _opt)
Definition: mixer.c:41
The information contained in a sideband buffer.
Definition: sideband.h:81
int(* server_cmd_handler_t)(struct command_context *, struct lls_parse_result *)
Prototype of a server command handler.
Definition: command.h:12
int read_nonblock(int fd, void *buf, size_t sz, size_t *num_bytes)
Read from a non-blocking file descriptor into a single buffer.
Definition: fd.c:256
int get_score_and_aft_row(struct osl_row *score_row, long *score, struct osl_row **aft_row)
Given an admissible file, get the corresponding row in the aft and the score.
Definition: score.c:176
@ DF_LOG_LL
Also print the loglevel for each message.
Definition: daemon.h:32
struct btr_node * btrn
The receiver node is always the root of the buffer tree.
Definition: recv.h:18
struct list_head task_list
Tasks which have been registered to the scheduler.
Definition: sched.h:35
#define DECLARE_BLOB_SYMBOLS(table_name, cmd_prefix)
Define exported functions and a table pointer for an osl blob table.
Definition: afs.h:291
#define PARA_WARNING_LOG(f,...)
Definition: para.h:220
#define EXPORT_SERVER_CMD_HANDLER(_cmd)
Define the user data structure for one command.
Definition: command.h:29
void check_wav_pre_monitor(struct sched *s, struct check_wav_context *cwc)
Request a minimal timeout if not idle.
Definition: check_wav.c:50
int para_reap_child(pid_t *pid)
Reap one child.
Definition: signal.c:99
int compute_word_num(const char *buf, const char *delim, int point)
Get the number of the word the cursor is on.
Definition: string.c:723
void(* init)(void)
Parse the command line options and initialize this sender (e.g., initialize target or access control ...
Definition: send.h:54
int client_connect(struct client_task *ct, struct sched *s, struct btr_node *parent, struct btr_node *child)
Connect to para_server and register the client task.
Definition: client_common.c:493
int lookup_address(unsigned l4type, bool passive, const char *host, int port_number, struct addrinfo **result)
Resolve an IPv4/IPv6 address.
Definition: net.c:396
@ SBD_PROCEED
Definition: sideband.h:66
int sample_format_arg
Same semantics as sample_rate.
Definition: check_wav.h:23
struct signal_task * signal_init_or_die(void)
Initialize the paraslash signal subsystem.
Definition: signal.c:35
char * parse_cidr(const char *cidr, char *addr, ssize_t addrlen, int32_t *netmask)
Functions to parse and validate (parts of) URLs.
Definition: net.c:40
bool uid_is_whitelisted(uid_t uid)
Lookup the given UID in the whitelist.
Definition: audiod.c:1413
int task_reap(struct task **tptr)
Obtain the error status of a task and deallocate its resources.
Definition: sched.c:169
size_t oac_custom_header_get(char **buf, struct oac_custom_header *h)
Return the custom header buffer and deallocate resources.
Definition: ogg_afh_common.c:437
#define dump_buffer(a, b, c)
Empty.
Definition: gcrypt.c:30
int n
Total number of codes.
Definition: wmadata.h:27
__a_const int lyrics_event_handler(__a_unused enum afs_events event, __a_unused struct para_buffer *pb, __a_unused void *data)
Dummy event handler for the lyrics table.
Definition: afs.c:1178
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: write.c:24
#define DIV_ROUND_UP(x, y)
Divide and round up to next integer.
Definition: para.h:138
void compute_chunk_time(long unsigned chunk_num, struct timeval *chunk_tv, struct timeval *stream_start, struct timeval *result)
Compute when to send a chunk of an audio file.
Definition: time.c:170
#define OPT_RESULT(_name)
Definition: play.c:35
exported symbols from daemon.c
struct stat_item_data data[NUM_STAT_ITEMS]
Individual status item properties.
Definition: gui.h:44
struct list_head node
The position of this client in the client list.
Definition: send.h:124
@ SBD_BLOB_DATA
Definition: sideband.h:66
struct gui_color_spec sb
Color of the status bar.
Definition: gui.h:46
void daemon_open_log_or_die(void)
Open the logfile in append mode.
Definition: daemon.c:289
int mp_parse_regex_pattern(const char *src, struct mp_re_pattern *result)
Parse and compile an extended regular expression pattern, including flags.
Definition: mp.c:157
void playlist_unload(struct playlist_instance *pi)
Free all resources of the given/current playlist.
Definition: playlist.c:117
size_t shm_get_shmmax(void)
Get the maximal size of a shared memory area.
Definition: ipc.c:211
@ AUDIO_FILE_ADD
An audio file was added.
Definition: afs.h:45
int score_update(const struct osl_row *aft_row, long new_score)
Replace a row of the score table.
Definition: score.c:136
Structure passed to the AFS max_size handler.
Definition: afs.h:197
exec_status
Type of the process currently being executed.
Definition: gui.c:61
void free_sender_status(const struct sender_status *ss)
Deallocate all resources allocated in init_sender_status().
Definition: send_common.c:166
void sched_request_timeout(struct timeval *to, struct sched *s)
Impose an upper bound for the I/O timeout.
Definition: sched.c:375
@ LS_SORT_BY_BITRATE
-s=b
Definition: aft.c:62
@ LS_MODE_VERBOSE
Definition: aft.c:72
struct btr_node * btrn[2]
The buffer tree nodes for receiving/sending.
Definition: client.h:34
int for_each_matching_row(struct pattern_match_data *pmd)
Execute the given function for each matching row.
Definition: afs.c:327
task_status
The possible states of a task.
Definition: sched.c:26
@ CHUNK_TV_TV_USEC_OFFSET
The microseconds part of the chunk time (4 bytes).
Definition: aft.c:315
__printf_2_0 unsigned xvasprintf(char **result, const char *fmt, va_list ap)
Print a formatted message to a dynamically allocated string.
Definition: string.c:181
int send_lls_callback_request(afs_callback *f, const struct lls_command *const cmd, struct lls_parse_result *lpr, void *private_result_data)
Wrapper for send_callback_request() which passes a lopsub parse result.
Definition: afs.c:264
const char * name
Name of the new node.
Definition: buffer_tree.h:156
__must_check __printf_1_2 __malloc char * make_message(const char *fmt,...)
Allocate a sufficiently large string and print into it.
Definition: string.c:237
uint64_t attributes
Bit field of set attributes.
Definition: afs.h:10
int i9e_extract_completions(const char *word, char **string_list, char ***result)
Return the possible completions for a given word.
Definition: interactive.c:635
void(* close)(struct filter_node *fn)
Close one instance of this filter.
Definition: filter.h:61
@ AFHI_UNUSED1_OFFSET
Was: Location of the audio file header.
Definition: aft.c:303
__printf_2_3 int para_printf(struct para_buffer *b, const char *fmt,...)
Safely print into a buffer at a given offset.
Definition: string.c:505
int default_timeout
Initial value (in milliseconds) before any pre_monitor call.
Definition: sched.h:19