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:44
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:265
#define DEFINE_BLOB_FUNCTIONS(table_name, short_name, c_short_name, ehandler)
Define all functions for this blob type.
Definition: blob.c:636
int score_get_best(struct osl_row **aft_row, long *score)
Get the admissible audio file with highest score.
Definition: score.c:222
#define para_isspace(c)
Wrapper for isspace.
Definition: para.h:174
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:157
#define MAX_STAT_CLIENTS
The maximal number of simultaneous connections.
Definition: audiod_command.c:34
#define OPT_GIVEN(_name)
Definition: gui.c:31
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:138
void daemon_set_logfile(const char *logfile_name)
Init or change the name of the log file.
Definition: daemon.c:128
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:386
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:348
void mp_shutdown(struct mp_context *ctx)
Deallocate the resources of a mood parser.
Definition: mp.c:583
#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:27
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:264
@ COLOR_STATUSBAR
Definition: gui.c:72
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:408
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:60
void client_close(struct client_task *ct)
Close the connection to para_server and free all resources.
Definition: client_common.c:37
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:218
#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:81
int para_atoi32(const char *str, int32_t *value)
Convert a string to a 32-bit signed integer value.
Definition: string.c:599
void mp_shutdown(struct mp_context *ctx)
Deallocate the resources of a mood parser.
Definition: mp.c:583
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:708
@ AFTCOL_AFSI
The audio file selector info.
Definition: upgrade_db.c:118
int create_argv(const char *buf, const char *delim, char ***result)
Split a buffer into words.
Definition: string.c:795
@ 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:246
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:47
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:37
int task_reap(struct task **tptr)
Obtain the error status of a task and deallocate its resources.
Definition: sched.c:168
uint32_t afs_socket_cookie
A random number used to "authenticate" the afs connection.
Definition: server.c:72
@ ATS_TRACK_CHANGE
A trak atom was seen after the mp4a atom.
Definition: mp4.c:33
const struct afs_table_operations score_ops
The score table stores (aft row, score) pairs in memory.
Definition: score.c:325
int decoder_execute(const char *cmd, unsigned sample_rate, unsigned channels, char **result)
Execute a btr command for a decoder.
Definition: filter_common.c:208
#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:126
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:180
const uint8_t * huffbits
VLC bit size.
Definition: wmadata.h:31
#define DCCP_SOCKOPT_AVAILABLE_CCIDS
List of supported CCIDs.
Definition: net.c:838
#define OPT_GIVEN(_name, _lpr)
Definition: recv.c:26
Exported symbols of the audio file selector.
int daemonize(bool parent_waits)
Do the usual stuff to become a daemon.
Definition: daemon.c:226
void generic_com_on(struct sender_status *ss, unsigned protocol)
Activate a paraslash sender.
Definition: send_common.c:281
int schedule(struct sched *s)
The core function of all paraslash programs.
Definition: sched.c:125
exported symbols from sideband.c
const struct filter lsg_filter_cmd_com_sync_user_data
Definition: sync_filter.c:376
int shm_destroy(int id)
Destroy the given shared memory area.
Definition: ipc.c:132
const char * version_single_line(const char *pfx)
Get the version string for an executable.
Definition: string.c:1100
#define RECEIVER_CMD(_a)
Definition: audiod.c:93
void version_handle_flag(const char *pfx, bool flag)
Print the version text and exit successfully.
Definition: string.c:1137
__malloc struct oac_custom_header * oac_custom_header_new(void)
Allocate and return a custom header structure.
Definition: ogg_afh_common.c:367
struct writer lsg_write_cmd_com_alsa_user_data
Definition: alsa_write.c:351
#define UNROLL
How often the loop is unrolled.
Definition: fec.c:171
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:64
@ CWS_NO_HEADER
First part of the stream did not look like a wav header.
Definition: check_wav.c:24
uint32_t lyrics_id
Lyrics blob associated with this file (foreign key).
Definition: afs.h:16
char ** i9e_complete_commands(const char *word, const struct i9e_completer *completers)
Return the list of partially matching words.
Definition: interactive.c:667
const struct filter lsg_filter_cmd_com_wmadec_user_data
Definition: wmadec_filter.c:1043
@ 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:472
#define RSA_PRIVKEY_SEXP
S-expression for a private RSA key.
Definition: gcrypt.c:110
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:770
const struct receiver lsg_recv_cmd_com_dccp_user_data
Definition: dccp_recv.c:160
#define CMD_PTR
Definition: audiod.c:40
void i9e_print_status_bar(char *buf, unsigned len)
Print the current status to stderr.
Definition: interactive.c:549
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:169
void para_sigaction(int sig, void(*handler)(int))
Install the given handler for the given signal.
Definition: signal.c:128
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:290
int para_accept(int fd, void *addr, socklen_t size, int *new_fd)
Wrapper around the accept system call.
Definition: net.c:820
#define MIN_CONSEC_GOOD_FRAMES
Definition: mp3_afh.c:25
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:69
void btr_pool_free(struct btr_pool *btrp)
Deallocate resources used by a buffer pool.
Definition: buffer_tree.c:88
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:164
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:687
@ AFSI_ATTRIBUTES_OFFSET
Storage position of the attributes bitmap.
Definition: aft.c:133
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:264
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:138
#define NUM_AFS_TABLES
Used to loop over the afs tables.
Definition: afs.c:63
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:248
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:559
int para_munmap(void *start, size_t length)
A wrapper for munmap(2).
Definition: fd.c:495
const char * author
Also printed at startup.
Definition: gui.h:30
__malloc char * para_hostname(void)
Get the own hostname.
Definition: string.c:345
Internal mood parser API (backend).
#define OPT_STRING_VAL(_name)
Definition: audiod.c:43
unsigned int vss_stopped(void)
Check if the vss is currently stopped.
Definition: vss.c:792
#define UNIX_PATH_MAX
The buffer size of the sun_path component of struct sockaddr_un.
Definition: net.c:882
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:200
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:561
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:125
int(* init_fec)(struct sender_client *sc)
Transport-layer initialisation for FEC support.
Definition: send.h:163
int i9e_cword_is_option_arg(char *const *opts, struct i9e_completion_info *ci)
Find out whether the current word is an argument to an option.
Definition: interactive.c:806
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:204
void imdct_end(struct mdct_context *s)
Deallocate imdct resources.
Definition: imdct.c:387
#define FOR_EACH_BUDDY(_buddy, _list)
Definition: sync_filter.c:48
#define OPT_RESULT(_name)
Definition: filter.c:26
#define WAV_HEADER_LEN
Length of a standard wav header.
Definition: check_wav.c:15
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:372
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:169
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:518
int aft_check_callback(struct afs_callback_arg *aca)
Check the audio file table for inconsistencies.
Definition: aft.c:2517
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:211
@ COLOR_ERRMSG
Definition: gui.c:76
global paraslash definitions
void para_unblock_signal(int sig)
Unblock a signal.
Definition: signal.c:194
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:20
const struct user * user_list_lookup(const char *name)
Lookup a user in the user list.
Definition: user_list.c:151
int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
Execute a file as a background process, honoring $PATH.
Definition: exec.c:132
#define PRIVATE_OPENSSH_KEY_FOOTER
Private OPENSSH keys (RFC4716) end with this footer.
Definition: crypt_common.c:263
void freep(void *arg)
Free the content of a pointer and set it to NULL.
Definition: string.c:257
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:737
__must_check __malloc char * para_strdup(const char *s)
Paraslash's version of strdup().
Definition: string.c:153
void daemon_set_priority(int prio)
Renice the calling process.
Definition: daemon.c:327
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:278
void audiod_status_dump(bool force)
Send the current audiod status to all connected stat clients.
Definition: audiod_command.c:445
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:250
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:17
check_wav_state
The possible states of a check_wav instance.
Definition: check_wav.c:18
void print_filter_helps(bool detailed)
Print help text of each filter to stdout.
Definition: filter_common.c:120
int apc_get_pubkey(const char *key_file, struct asymmetric_key **result)
Read an asymmetric key from a file.
Definition: openssl.c:333
void del_close_on_fork_list(int fd)
Delete one file descriptor from the close-on-fork list.
Definition: close_on_fork.c:49
#define CLIENT_BUFSIZE
The size of the receiving buffer.
Definition: client_common.c:28
char ** i9e_complete_commands(const char *word, const struct i9e_completer *completers)
Return the list of partially matching words.
Definition: interactive.c:667
void daemon_set_loglevel(int loglevel)
Control the verbosity for logging.
Definition: daemon.c:149
const char * paraslash_version(void)
Return the single line git version string.
unsigned i9e_get_nonopt_argnum(char *const *opts, struct i9e_completion_info *ci)
Return the number of non-option arguments encountered so far.
Definition: interactive.c:738
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:45
struct stream_cipher * sc_new(const unsigned char *data, int len)
Allocate and initialize an aes_ctr128 stream cipher structure.
Definition: gcrypt.c:630
#define NUM_MAPPED_KEYS
Definition: play.c:529
int parse_fec_url(const char *arg, struct sender_command_data *scd)
Parse a FEC URL string.
Definition: send_common.c:490
void generic_acl_deplete(struct list_head *acl)
Empty the access control list of a sender.
Definition: send_common.c:247
@ 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:562
#define FOR_EACH_STATUS_ITEM(i)
Loop over each status item.
Definition: para.h:280
ssize_t send_cred_buffer(int, char *)
Send a buffer and the credentials of the current process to a socket.
Definition: net.c:1028
#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:1165
__must_check __malloc char * para_homedir(void)
Get the home directory of the calling user.
Definition: string.c:318
void free_lpr(void)
Deallocate all lopsub parse results.
Definition: server.c:629
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:951
char * prompt
Text of the current prompt.
Definition: interactive.h:65
void crypt_init(void)
Initialize the crypto backend.
Definition: gcrypt.c:74
@ BLOB_REMOVE
A blob is about to be removed.
Definition: afs.h:55
@ 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:102
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:561
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:872
@ GM_SLOPPY
Ignore the data and do not write.
Definition: grab_client.c:25
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:622
@ EXEC_XCMD
External process running.
Definition: gui.c:62
#define FOR_EACH_FECDEC_GROUP(g, d)
Iterate over all fecdec groups.
Definition: fecdec_filter.c:81
int send_queued_chunks(int fd, struct chunk_queue *cq)
Try to empty the chunk queue for this fd.
Definition: send_common.c:82
void vss_del_fec_client(struct fec_client *fc)
Remove one entry from the list of active fec clients.
Definition: vss.c:686
_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:345
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:204
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:510
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:60
void i9e_ll_completer(struct i9e_completion_info *ci, struct i9e_completion_result *cr)
Complete on severity strings.
Definition: interactive.c:915
#define CMD_PTR
Definition: play.c:32
int i9e_cword_is_option_arg(char *const *opts, struct i9e_completion_info *ci)
Find out whether the current word is an argument to an option.
Definition: interactive.c:806
@ SCORECOL_SCORE
The score.
Definition: score.c:49
void playlist_unload(struct playlist_instance *pi)
Free all resources of the given/current playlist.
Definition: playlist.c:103
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:135
int xwritev(int fd, struct iovec *iov, int iovcnt)
Write an array of buffers, handling non-fatal errors.
Definition: fd.c:63
#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:401
#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:759
__malloc char * generic_sender_help(void)
Get the generic help text.
Definition: send_common.c:415
#define OPT_UINT32_VAL(_name)
Definition: afh.c:23
__must_check int strwidth(const char *s, size_t *result)
Compute the width of an UTF-8 string.
Definition: string.c:996
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:159
void daemon_open_log_or_die(void)
Open the logfile in append mode.
Definition: daemon.c:288
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:28
#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:262
int para_atoi64(const char *str, int64_t *result)
llong_minmax
Definition: string.c:562
#define NUM_LINES(len)
Number of lines of the window are occupied by an output line.
Definition: gui.c:184
int para_listen(unsigned l4type, const char *addr, uint16_t port)
Create a passive / listening socket.
Definition: net.c:541
bool sockaddr_equal(const struct sockaddr *sa1, const struct sockaddr *sa2)
Compare the address part of IPv4/6 addresses.
Definition: net.c:736
void clear_and_dump_items(void)
Flush and send all status items.
Definition: audiod_command.c:494
#define NUM_FEC_GROUPS
How many FEC groups to store in memory.
Definition: fecdec_filter.c:23
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:594
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:206
const struct i9e_completer * completers
The array of completers, one per command.
Definition: interactive.h:73
__must_check __malloc char * para_logname(void)
Get the logname of the current user.
Definition: string.c:303
#define MAXLINE
used in various contexts
Definition: para.h:29
const struct afs_table_operations attr_ops
The attribute table stores name/bitnum pairs.
Definition: attribute.c:493
void stdin_task_register(struct stdin_task *sit, struct sched *s)
Register a stdin task structure.
Definition: stdin.c:86
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:157
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:271
__must_check __malloc char * para_strcat(char *a, const char *b)
Paraslash's version of strcat().
Definition: string.c:281
int main(int argc, char *argv[])
Definition: upgrade_db.c:343
int dispatch_local_connection(int accept_fd)
Handle arriving connections on the local socket.
Definition: audiod_command.c:386
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:663
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:198
__malloc char * audiod_get_decoder_flags(void)
Return the flags for the decoder_flags status item.
Definition: audiod.c:218
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.
Definition: afs.c:957
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:307
int recv_bin_buffer(int fd, char *buf, size_t size)
Receive data from a file descriptor.
Definition: net.c:768
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:310
#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:196
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:176
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:28
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:60
unsigned char * challenge_hash
The hash value of the decrypted challenge.
Definition: client.h:36
int64_t mp_num_attributes_set(struct mp_context *ctx)
Count the number of attributes set.
Definition: mp.c:329
#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:284
#define EXPVLCBITS
Definition: wmadec_filter.c:106
#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:120
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: mixer.c:17
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:206
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:493
void vss_del_fec_client(struct fec_client *fc)
Remove one entry from the list of active fec clients.
Definition: vss.c:686
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:17
struct gui_color_spec color
Foreground and background color.
Definition: gui.h:21
@ AUDIO_FILE_RENAME
An audio file was renamed.
Definition: afs.h:45
@ PLAY_MODE_MOOD
Admissible files are determined by a mood definition.
Definition: afs.h:92
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:269
#define DECODER_SAMPLE_FORMAT
Definition: filter_common.c:191
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:814
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:211
#define CMD_PTR
Definition: audioc.c:30
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:114
__must_check int mark_fd_nonblocking(int fd)
Set a file descriptor to non-blocking mode.
Definition: fd.c:325
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:694
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:493
@ FEC_GROUP_USABLE
Use all data in the group.
Definition: fecdec_filter.c:254
int makesock_addrinfo(unsigned l4type, bool passive, struct addrinfo *ai, struct flowopts *fo)
Create an active or passive socket.
Definition: net.c:448
void hash_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash of the given input data.
Definition: gcrypt.c:32
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:630
int read_size_header(const char *buf)
Read a four-byte hex-number and return its value.
Definition: string.c:446
const char * filter_name(int filter_num)
Return the name of a filter, given its number.
Definition: filter_common.c:51
const struct audio_format_handler opus_afh
The audio format handler for ogg/opus.
Definition: opus_afh.c:299
void print_filter_list(void)
Print a short summary of all available filters to stdout.
Definition: filter_common.c:157
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:718
void apc_free_pubkey(struct asymmetric_key *key)
Deallocate a public key.
Definition: gcrypt.c:472
int schedule(struct sched *s)
The core function of all paraslash programs.
Definition: sched.c:125
#define INTERNAL_KEYMAP_ENTRIES
Definition: play.c:497
int para_mkdir(const char *path)
Create a directory, don't fail if it already exists.
Definition: fd.c:400
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:1202
@ LS_SORT_BY_IMAGE_ID
-s=i
Definition: aft.c:59
#define FEC_EOF_PACKET_LEN
The number of bytes of the FEC_EOF_PACKET.
Definition: para.h:180
void add_close_on_fork_list(int fd)
Add one file descriptor to the close-on-fork list.
Definition: close_on_fork.c:30
size_t btr_pool_unused(const struct btr_pool *btrp)
Get the number of unused bytes in the buffer pool.
Definition: buffer_tree.c:131
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:115
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:169
@ SBD_WARNING_LOG
Definition: sideband.h:66
void parse_config_or_die(bool reload)
(Re-)read the server configuration files.
Definition: server.c:180
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:96
@ 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
#define OPT_GIVEN(_name, _lpr)
Definition: write.c:27
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:1451
#define RSA_DECRYPT_SEXP
S-expression for decryption.
Definition: gcrypt.c:112
#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:663
@ 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:1428
@ 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:448
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: recv.c:21
int task_get_notification(const struct task *t)
Return the notification value of a task.
Definition: sched.c:310
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:204
#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:380
int read_asf_header(const char *buf, int loaded, struct asf_header_info *ahi)
Read an asf audio file header.
Definition: wma_common.c:85
#define DEFINE_BLOB_COMPLETER(cmd, blob_type)
Definition: client.c:507
int hash_compare(const unsigned char *h1, const unsigned char *h2)
Compare two hashes.
Definition: crypt_common.c:148
@ CWS_HAVE_HEADER
Wav hader was detected.
Definition: check_wav.c:22
#define PRIVATE_OPENSSH_KEY_HEADER
Private OPENSSH keys (RFC4716) start with this header.
Definition: crypt_common.c:259
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:656
__must_check __malloc __printf_1_2 char * make_message(const char *fmt,...)
Allocate a sufficiently large string and print into it.
Definition: string.c:236
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:428
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
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:489
void client_close(struct client_task *ct)
Close the connection to para_server and free all resources.
Definition: client_common.c:37
void para_install_sighandler(int)
Install the generic signal handler for the given signal number.
Definition: signal.c:159
int mp4_update_meta(struct mp4 *f)
Write back the modified metadata items to the mp4 file.
Definition: mp4.c:1000
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:605
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:153
int para_reap_child(pid_t *pid)
Reap one child.
Definition: signal.c:98
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:74
const char * name
Printed at startup.
Definition: gui.h:28
int write_all(int fd, const void *buf, size_t len)
Write to a file descriptor, fail on short writes.
Definition: fd.c:141
#define MAX_STREAM_SLOTS
Maximal number of simultaneous instances.
Definition: audiod.c:97
struct signal_task * signal_init_or_die(void)
Initialize the paraslash signal subsystem.
Definition: signal.c:34
char * parse_cidr(const char *cidr, char *addr, ssize_t addrlen, int32_t *netmask)
Parse and validate IPv4 address/netmask string.
Definition: net.c:39
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:217
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:50
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:455
#define MAX_CQ_BYTES
Clients will be kicked if there are more than that many bytes pending.
Definition: send_common.c:30
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:434
const struct sender udp_sender dccp_sender http_sender
The HTTP sender.
Definition: http_send.c:269
#define ARRAY_SIZE(arr)
Get the size of an array.
Definition: para.h:159
const char * stat_item_values[NUM_STAT_ITEMS]
The array of status items sent by para_server.
Definition: audiod.c: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:348
int check_wav_post_monitor(struct check_wav_context *cwc)
Filter out the wav header, pushdown everything else.
Definition: check_wav.c:122
int mp4_open_meta(const struct mp4_callback *cb, struct mp4 **result)
Open an mp4 file in metadata-only mode.
Definition: mp4.c:842
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:156
__must_check __malloc char * para_strdup(const char *s)
Paraslash's version of strdup().
Definition: string.c:153
void daemon_log_welcome(const char *name)
Log the startup message containing the paraslash version.
Definition: daemon.c:314
void vss_init(int afs_socket, struct sched *s)
Initialize the virtual streaming system task.
Definition: vss.c:1164
void score_clear(void)
Remove all entries from the score table, but keep the table open.
Definition: score.c:318
void vss_shutdown(void)
Turn off the virtual streaming system.
Definition: vss.c:1202
#define BLOCK_MAX_SIZE
Definition: wmadec_filter.c:36
int score_delete(const struct osl_row *aft_row)
Remove an entry from the rbtree of admissible files.
Definition: score.c:246
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:149
__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:180
void deplete_close_on_fork_list(void)
Remove all listed fds from the close on fork list.
Definition: close_on_fork.c:96
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:230
@ NUM_SB_DESIGNATORS
Definition: sideband.h:66
const struct mixer oss_mixer
The mixer operations for the OSS mixer.
Definition: oss_mix.c:134
const struct filter * filter_get(int filter_num)
Obtain a reference to a filter structure.
Definition: filter_common.c:31
audio_file_table_columns
The columns of the audio file table.
Definition: aft.c:200
#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:296
struct gui_color_spec cmd
Color of the name and args of the executing process.
Definition: gui.h:48
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:158
void shutdown_client(struct sender_client *sc, struct sender_status *ss)
Shut down a client connected to a paraslash sender.
Definition: send_common.c:44
int xwrite(int fd, const void *buf, size_t len)
Write a buffer to a file descriptor, re-writing on short writes.
Definition: fd.c:122
@ FEC_STATE_DISABLED
temporarily disabled
Definition: vss.c:124
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:200
int recv_cred_buffer(int, char *, size_t)
Receive a buffer and the Unix credentials of the sending process.
Definition: net.c:1081
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:142
int attribute_check_callback(struct afs_callback_arg *aca)
Compute the attribute bit mask and check each afs info bitmap.
Definition: attribute.c:448
unsigned ringbuffer_filled(struct ringbuffer *rb)
Get the number of entries in the ring buffer.
Definition: ringbuffer.c:96
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:390
@ 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
const char * stat_item_values[NUM_STAT_ITEMS]
Dummy version which only contains NULL pointers.
Definition: filter.c:37
#define MP_TAG(_name)
Define a function which extracts and returns the value of a meta tag.
Definition: mp.c:422
unsigned input_skip
Do not try to match the first inputs of lpr.
Definition: afs.h:143
#define VLCBITS
Definition: wmadec_filter.c:107
unsigned parse_quoted_string(const char *src, const char quote_chars[2], char **result)
Parse a (generalized) string literal.
Definition: mp.c:83
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:131
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:78
@ CRT_TERM_RQ
Someone wants us for dead (com_quit()).
Definition: play.c:55
size_t btr_pool_size(const struct btr_pool *btrp)
Return the size of the buffer pool area.
Definition: buffer_tree.c:105
unsigned int vss_paused(void)
Check if the vss is currently paused.
Definition: vss.c:780
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:408
ls_listing_mode
The different listing modes of the ls command.
Definition: aft.c:68
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: upgrade_db.c:23
@ AFHI_HEADER_LEN_OFFSET
Definition: aft.c:304
uint16_t mp4_get_channel_count(const struct mp4 *f)
Return the number of channels of the audio track.
Definition: mp4.c:809
@ SBD_NOTICE_LOG
Definition: sideband.h:66
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: client.c:21
int para_listen_simple(unsigned l4type, uint16_t port)
Create a socket which listens on all network addresses.
Definition: net.c:579
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:61
int send_queued_chunks(int fd, struct chunk_queue *cq)
Try to empty the chunk queue for this fd.
Definition: send_common.c:82
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:86
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:224
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:489
#define OPT_STRING_VAL(_cmd, _opt)
Definition: mixer.c:38
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:996
const struct sender *const senders[]
NULL-terminated list, defined in vss.c.
Definition: vss.c:38
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:230
@ COLOR_MSG
Definition: gui.c:75
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:28
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:736
#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:186
const struct mixer alsa_mixer
The mixer operations for the ALSA mixer.
Definition: alsa_mix.c:215
int i9e_open(struct i9e_client_info *ici, struct sched *s)
Register the i9e task and initialize readline.
Definition: interactive.c:442
void hash2_to_asc(const unsigned char *hash, char *asc)
Convert a hash2 value to ascii format.
Definition: crypt_common.c:161
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:986
int(* mixer_subcommand_handler_t)(const struct mixer *)
Definition: mixer.c:41
int main(int argc, char **argv)
The main function of para_afh.
Definition: afh.c:208
void i9e_signal_dispatch(int sig_num)
Tell i9e that the caller received a signal.
Definition: interactive.c:578
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:21
@ 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:15
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:60
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:682
void daemon_set_log_color_or_die(const char *arg)
Set the color for log messages of the given severity level.
Definition: daemon.c:64
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:429
@ AFTCOL_CHUNKS
The chunk table info and the chunk table of the audio file.
Definition: upgrade_db.c:122
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:511
@ 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:69
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:719
void hash_to_asc(const unsigned char *hash, char *asc)
Convert a hash value to ascii format.
Definition: crypt_common.c:136
#define PAD64
The padding character which is appended to base64 encoded data.
Definition: base64.c:61
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:493
bool need_periodic_header
Whether the header must be sent periodically.
Definition: send.h:151
#define AFH_RECV_CMD
Definition: play.c:112
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:138
pid_t afs_pid
The process id of the audio file selector process.
Definition: server.c:84
void sc_free(struct stream_cipher *sc)
Deallocate a stream cipher structure.
Definition: gcrypt.c:648
void task_notify(struct task *t, int err)
Set the notification value of a task.
Definition: sched.c:290
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:135
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:60
char * remote_name(int fd)
Look up the remote side of a connected socket structure.
Definition: net.c:682
Audio format dependent information.
Definition: afh.h:25
#define DCCP_SOCKOPT_CCID
Sets both TX/RX CCID.
Definition: dccp_recv.c:30
void hash_to_asc(const unsigned char *hash, char *asc)
Convert a hash value to ascii format.
Definition: crypt_common.c:136
void user_list_init(const char *user_list_file)
Initialize the list of users allowed to connect to para_server.
Definition: user_list.c:69
int main(int argc, char *argv[])
The main function of para_play.
Definition: play.c:1199
struct lls_parse_result * server_lpr
The active value for all config options of para_server.
Definition: server.c:58
void valid_fd_012(void)
Ensure that file descriptors 0, 1, and 2 are valid.
Definition: fd.c:568
@ 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:222
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: filter.c:22
#define OGGDEC_MAX_OUTPUT_SIZE
Suspend decoding if output queue size is larger than that.
Definition: oggdec_filter.c:188
int main(int argc, char *argv[])
The main function of para_server.
Definition: server.c:644
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:75
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:474
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:158
void audiod_status_dump(bool force)
Send the current audiod status to all connected stat clients.
Definition: audiod_command.c:445
const struct filter * filter_get(int filter_num)
Obtain a reference to a filter structure.
Definition: filter_common.c:31
struct flowopts * flowopt_new(void)
Allocate and initialize a flowopt queue.
Definition: net.c:297
#define CMD_PTR
Definition: afh.c:19
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:120
int para_listen_simple(unsigned l4type, uint16_t port)
Create a socket which listens on all network addresses.
Definition: net.c:579
void i9e_close(void)
Reset the terminal and save the in-memory command line history.
Definition: interactive.c:204
@ AFTCOL_PATH
The full path in the filesystem.
Definition: aft.c:204
#define OPT_GIVEN(_name, _lpr)
Definition: upgrade_db.c:18
#define PARA_CRIT_LOG(f,...)
Definition: para.h:225
@ NUM_SCORE_COLUMNS
This table has two columns.
Definition: score.c:51
int makesock_addrinfo(unsigned l4type, bool passive, struct addrinfo *ai, struct flowopts *fo)
Create an active or passive socket.
Definition: net.c:448
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:306
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:438
#define MAX_FRAME_SIZE
120ms at 48000
Definition: opusdec_filter.c:59
@ VSS_WRITE
Read-only operation on the virtual streaming system.
Definition: user_list.h:18
#define FOR_EACH_MIXER(i)
Definition: mixer.c:30
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:327
const struct filter lsg_filter_cmd_com_compress_user_data
Definition: compress_filter.c:160
void activate_grab_clients(struct sched *s)
Activate inactive grab clients if possible.
Definition: grab_client.c:150
#define BLOCK_MIN_BITS
Definition: wmadec_filter.c:34
uint16_t mp4_get_sample_rate(const struct mp4 *f)
Return the sample rate stored in the stsd atom.
Definition: mp4.c:795
#define DCCP_SOCKOPT_TX_CCID
Set/get the TX CCID.
Definition: dccp_send.c:48
#define FILTER_CMD(_num)
Definition: filter.h:102
void para_unblock_signal(int sig)
Unblock a signal.
Definition: signal.c:194
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:442
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:88
void i9e_signal_dispatch(int sig_num)
Tell i9e that the caller received a signal.
Definition: interactive.c:578
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:34
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:169
@ ATTRIBUTE_REMOVE
An attribute was removed.
Definition: afs.h:37
@ AFS_SOCKET_CHECK_FOR_WRITE
Socket fd was monitored for writing.
Definition: vss.c:46
size_t btr_pool_get_buffer(const struct btr_pool *btrp, char **result)
Obtain the current write head.
Definition: buffer_tree.c:158
@ LS_MODE_PARSER
-l=c
Definition: aft.c:74
#define EXPORT_CMD(_cmd)
Definition: mixer.c:43
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:463
unsigned i9e_get_nonopt_argnum(char *const *opts, struct i9e_completion_info *ci)
Return the number of non-option arguments encountered so far.
Definition: interactive.c:738
int main(int argc, char *argv[])
The main function of para_recv.
Definition: recv.c:61
void oac_custom_header_flush(struct oac_custom_header *h)
Force remaining packets into an ogg page.
Definition: ogg_afh_common.c:411
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:98
@ 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:129
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:589
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:122
__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:183
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:203
__malloc char * get_time_string(void)
Compute the play time based on information of the current slot.
Definition: audiod.c:291
Structures and prototypes common to audio format handlers that use the ogg container format.
@ AFSI_IMAGE_ID_OFFSET
Storage position of the .image_id field.
Definition: aft.c:137
_static_inline_ const char * para_strerror(int num)
Paraslash's version of strerror(3).
Definition: error.h:291
int i9e_print_completions(const struct i9e_completer *completers)
Print possible completions to stdout.
Definition: interactive.c:845
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 CMD_PTR
Definition: filter.c:25
#define EMBRACE(...)
Used to avoid a shortcoming in vim's syntax highlighting.
Definition: para.h:183
void user_list_init(const char *user_list_file)
Initialize the list of users allowed to connect to para_server.
Definition: user_list.c:69
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:510
struct lls_parse_result * server_lpr
The active value for all config options of para_server.
Definition: server.c:58
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:2571
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: server.c:39
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:125
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:159
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:368
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:493
void mp_parse_wildcard_pattern(const char *src, struct mp_wc_pattern *result)
Parse a wildcard pattern, including flags.
Definition: mp.c:196
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:139
int apc_get_pubkey(const char *key_file, struct asymmetric_key **result)
Read an asymmetric key from a file.
Definition: gcrypt.c:426
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:670
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:1538
#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:29
void score_close(struct osl_table *t)
Free all volatile objects, then close the table.
Definition: score.c:283
int xwritev(int fd, struct iovec *iov, int iovcnt)
Write an array of buffers, handling non-fatal errors.
Definition: fd.c:63
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:842
#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:161
int i9e_extract_completions(const char *word, char *const *string_list, char ***result)
Return the possible completions for a given word.
Definition: interactive.c:633
@ AUDIO_FILE_REMOVE
An audio file is about to be removed.
Definition: afs.h:49
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:102
void vss_init(int afs_socket, struct sched *s)
Initialize the virtual streaming system task.
Definition: vss.c:1164
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:187
#define OPT_STRING_VAL(_name)
Definition: gui.c:32
void crypt_shutdown(void)
Allocate all resources of the crypto backend.
Definition: gcrypt.c:98
void set_max_chunk_size(struct afh_info *afhi)
Determine the maximal chunk size by iterating the chunk table.
Definition: afh_common.c:436
#define OPT_UINT32_VAL(_name)
Definition: audioc.c:35
#define NUM_SUPPORTED_MIXERS
Definition: mixer.c:29
__must_check __malloc char * para_logname(void)
Get the logname of the current user.
Definition: string.c:303
@ 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:75
int main(int argc, char *argv[])
The client program to connect to para_server.
Definition: client.c:675
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:107
char * key_value_copy(const char *src, size_t len, const char *key)
Copy the value of a key=value pair.
Definition: string.c:886
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:35
bool sched_write_ok(int fd, const struct sched *s)
Check whether writing is possible (i.e., does not block).
Definition: sched.c:559
void user_list_deplete(void)
Remove all entries from the user list.
Definition: user_list.c:47
void mp4_close(struct mp4 *f)
Deallocate all resources associated with an mp4 file handle.
Definition: mp4.c:591
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:396
int load_afd(int shmid, struct audio_file_data *afd)
Extract an audio file data structure from a shared memory area.
Definition: aft.c:649
const char * stringify_port(int port, const char *transport)
Stringify port number, resolve into service name where defined.
Definition: net.c:216
@ CRT_NONE
Everybody is happy.
Definition: play.c:49
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:78
struct writer lsg_write_cmd_com_file_user_data
the init function of the file writer
Definition: file_write.c:129
void sched_shutdown(struct sched *s)
Deallocate all resources of all tasks of a scheduler instance.
Definition: sched.c:203
void set_max_chunk_size(struct afh_info *afhi)
Determine the maximal chunk size by iterating the chunk table.
Definition: afh_common.c:436
const char * status_item_list[]
The list of all status items used by para_{server,audiod,gui}.
Definition: audiod_command.c:80
int i9e_print_completions(const struct i9e_completer *completers)
Print possible completions to stdout.
Definition: interactive.c:845
int get_vlc(struct getbit_context *gbc, const struct vlc *vlc)
Parse a vlc code.
Definition: bitstream.c:170
#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:423
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:526
int send_errctx(struct command_context *cc, char *errctx)
Send an error context to a client,.
Definition: command.c:213
@ AFTCOL_HASH
The hash on the content of the audio file.
Definition: aft.c:202
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:29
#define GF_BITS
Code over GF(256).
Definition: fec.c:42
void mp_free_ast(struct mp_ast_node *root)
Deallocate an abstract syntax tree.
loglevels
sample_format
Definition: para.h:218
const struct timeval * now
This is set by the scheduler at the beginning of its main loop.
Definition: sched.c:46
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:316
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:747
bool uid_is_whitelisted(uid_t uid)
Lookup the given UID in the whitelist.
Definition: audiod.c:1410
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:436
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:500
const char * audio_format_name(int)
audio_format_handler
Definition: afh_common.c:55
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:50
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:1081
const char * version_text(const char *pfx)
Get the full version text.
Definition: string.c:1120
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:100
void score_open(struct osl_table **result)
Allocate a score table instance.
Definition: score.c:307
int read_size_header(const char *buf)
Read a four-byte hex-number and return its value.
Definition: string.c:446
struct stream_cipher * sc_new(const unsigned char *data, int len)
Allocate and initialize an aes_ctr128 stream cipher structure.
Definition: openssl.c:479
@ CWS_NEED_HEADER
Initial state, less than WAV_HEADER_LEN bytes available.
Definition: check_wav.c:20
int connect_local_socket(const char *name)
Prepare, create, and connect to a Unix domain socket for local communication.
Definition: net.c:986
int i9e_extract_completions(const char *word, char *const *string_list, char ***result)
Return the possible completions for a given word.
Definition: interactive.c:633
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:169
The structure of server and afs commands.
int main(int argc, char *argv[])
The main function of para_mixer.
Definition: mixer.c:568
#define FEC_SWAP(a, b)
Swap two numbers.
Definition: fec.c:234
#define GET_NUM_DIGITS(x, num)
Compute the number of (decimal) digits of a number.
Definition: aft.c:707
const struct filter lsg_filter_cmd_com_spxdec_user_data
Definition: spxdec_filter.c:304
#define ALARM_TIMEOUT
Shut down non-authorized connections after that many seconds.
Definition: server.c:44
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:400
int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr, int *loglevel)
Parse a client configuration.
Definition: client_common.c:559
@ SBD_ERROR_LOG
Definition: sideband.h:66
@ ATTCOL_BITNUM
The bit number (0-63).
Definition: attribute.c:25
__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:183
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:374
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:312
@ CAB_LPR_OFFSET
Start of the (serialized) lopsub parse result.
Definition: aft.c:1569
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:33
void sched_monitor_writefd(int fd, struct sched *s)
Instruct the scheduler to monitor an fd for readiness for writing.
Definition: sched.c:511
int audiod_status
The current mode of operation (AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY).
Definition: audiod.c:164
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:525
@ LS_SORT_BY_CHANNELS
-s=c
Definition: aft.c:58
int para_open(const char *path, int flags, mode_t mode)
Wrapper for the open(2) system call.
Definition: fd.c:379
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:71
@ LS_SORT_BY_NUM_PLAYED
-s=n
Definition: aft.c:56
struct sched sched
The scheduler instance of para_audiod.
Definition: audiod.c:122
@ 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:116
@ 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:91
#define NB_LSP_COEFS
Definition: wmadata.h:63
int para_mmap(size_t length, int prot, int flags, int fd, void *map)
Paraslash's wrapper for mmap.
Definition: fd.c:350
@ 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:78
__must_check void * para_realloc(void *p, size_t size)
Paraslash's version of realloc().
Definition: string.c:115
int read_ok(int fd)
Check a file descriptor for readability.
Definition: fd.c:538
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:158
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:198
#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:1000
#define OPT_RESULT(_cmd, _opt)
Definition: mixer.c:35
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:605
#define CMD_PTR
Definition: recv.c:23
#define AUTH_REQUEST_MSG
Sent by para_client to initiate the authentication procedure.
Definition: para.h:80
int para_atoi32(const char *str, int32_t *value)
Convert a string to a 32-bit signed integer value.
Definition: string.c:599
void generic_acl_deplete(struct list_head *acl)
Empty the access control list of a sender.
Definition: send_common.c:247
void get_random_bytes_or_die(unsigned char *buf, int num)
Fill a buffer with random content.
Definition: gcrypt.c:64
int score_update(const struct osl_row *aft_row, long percent)
Replace a row of the score table.
Definition: score.c:135
int for_each_line(unsigned flags, char *buf, size_t size, line_handler_t *line_handler, void *private_data)
Call a function for each complete line in a buffer.
Definition: string.c:379
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: gui.c:25
int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
Execute a file as a background process, honoring $PATH.
Definition: exec.c:132
#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:46
@ 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:648
#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:86
@ VSS_STATUS_FLAG_NEXT
Whether the 'N' flag is set.
Definition: audiod.c:111
#define CMD_PTR
Definition: upgrade_db.c:15
void sc_free(struct stream_cipher *sc)
Deallocate a stream cipher structure.
Definition: openssl.c:490
#define MAX_COMMAND_LEN
server_cmd_aux_info
Definition: command.c:43
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:98
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:392
#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:247
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:232
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:342
int mmd_mutex
The mutex protecting the shared memory area containing the mmd struct.
Definition: server.c:75
__malloc char * format_url(const char *url, int default_port)
Pretty-print a host/port pair.
Definition: net.c:192
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:34
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
const char * version_single_line(const char *pfx)
Get the version string for an executable.
Definition: string.c:1100
void daemon_close_log(void)
Close the log file of the daemon.
Definition: daemon.c:274
@ 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:513
int open_and_update_audio_file(int *fd)
Open the audio file with highest score and set up an afd structure.
Definition: aft.c:1042
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:384
#define OPT_UINT32_VAL(_name)
Definition: play.c:36
int write_ok(int fd)
Check a file descriptor for writability.
Definition: fd.c:555
@ ASN1_TYPE_INTEGER
The next object is an integer.
Definition: gcrypt.c:127
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:146
#define OPT_GIVEN(_opt, _lpr)
Definition: resample_filter.c:19
#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:35
void sb_free(struct sb_context *c)
Deallocate all memory associated with a sideband handle.
Definition: sideband.c:103
__printf_2_3 void(* para_log)(int, const char *,...)
The log function of para_gui, always set to curses_log().
Definition: afh.c:26
void para_sigaction(int sig, void(*handler)(int))
Install the given handler for the given signal.
Definition: signal.c:128
__printf_2_3 void i9e_log(int ll, const char *fmt,...)
The log function of the i9e subsystem.
Definition: interactive.c:525
@ 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:132
int xwrite(int fd, const void *buf, size_t len)
Write a buffer to a file descriptor, re-writing on short writes.
Definition: fd.c:122
#define OPT_UINT32_VAL(_name)
Definition: filter.c:29
void get_attribute_bitmap(const uint64_t *atts, char *buf)
Return a binary representation of the given attribute value.
Definition: attribute.c:364
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:81
__printf_2_3 void daemon_log(int ll, const char *fmt,...)
The log function for para_server and para_audiod.
Definition: daemon.c:443
bool sched_read_ok(int fd, const struct sched *s)
Check whether there is data to read on the given fd.
Definition: sched.c:544
unsigned flags
Definition: string.h:20
#define FEC_EOF_PACKET
Data that indicates an eof-condition for a fec-encoded stream.
Definition: para.h:177
__must_check void * para_realloc(void *p, size_t size)
Paraslash's version of realloc().
Definition: string.c:115
#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:317
#define DECL_FFT(n, n2, n4)
Definition: imdct.c:163
Structures for audio format handling (para_server).
unsigned int vss_paused(void)
Check if the vss is currently paused.
Definition: vss.c:780
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:48
fec_group_usability
The different states of a complete FEC group.
Definition: fecdec_filter.c:250
#define FOR_EACH_FRAME(_f, _buf, _size, _ps)
Definition: wma_afh.c:16
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:45
void i9e_attach_to_stdout(struct btr_node *producer)
Prepare writing to stdout.
Definition: interactive.c:173
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:88
#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:277
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:439
#define MIN_FRAME_SIZE
Definition: mp3_afh.c:27
void afh_close(void *afh_context, uint8_t audio_format_id)
Deallocate resources allocated due to dynamic chunk handling.
Definition: afh_common.c:286
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:162
const struct filter lsg_filter_cmd_com_opusdec_user_data
Definition: opusdec_filter.c:285
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:152
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:14
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:44
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:474
void free_sender_status(const struct sender_status *ss)
Deallocate all resources allocated in init_sender_status().
Definition: send_common.c:165
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: audioc.c:25
void flowopt_cleanup(struct flowopts *fo)
Deallocate all resources of a flowopts structure.
Definition: net.c:362
void add_close_on_fork_list(int fd)
Add one file descriptor to the close-on-fork list.
Definition: close_on_fork.c:30
@ LS_SORT_BY_HASH
-s=h
Definition: aft.c:64
Arguments passed to each afs callback.
Definition: afs.h:153
int load_afd(int shmid, struct audio_file_data *afd)
Extract an audio file data structure from a shared memory area.
Definition: aft.c:649
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:44
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:43
#define OPT_STRING_VAL(_name, _lpr)
Definition: recv.c:28
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:1538
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:511
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:719
#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:27
com_add_buffer_offsets
The format of the data stored by save_audio_file_data().
Definition: aft.c:1563
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:35
@ HTTP_STREAMING
Definition: http_recv.c:30
@ BLOB_ADD
A new blob was added.
Definition: afs.h:51
@ LS_MODE_CHUNKS
-l=m
Definition: aft.c:73
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:196
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:170
int generic_max_transport_msg_size(int sockfd)
Get the maximum transport-layer message size (MMS_S).
Definition: net.c:657
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:86
__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:1050
#define TELL_CB_DUMMY_VAL
Definition: flacdec_filter.c:92
void afh_free_header(char *header_buf, uint8_t audio_format_id)
Deallocate any resources obtained from afh_get_header().
Definition: afh_common.c:372
#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:849
grab_mode
How to handle blocking writes for the grab client fds.
Definition: grab_client.c:23
#define gf_mul(x, y)
Multiply two GF numbers.
Definition: fec.c:71
__printf_2_3 void(* para_log)(int, const char *,...)
Definition: audiod.c:46
const struct audio_format_handler ogg_afh
The ogg vorbis audio format handler.
Definition: ogg_afh.c:181
blob_table_columns
blob_symbols
Definition: afs.h:310
struct flowopts * flowopt_new(void)
Allocate and initialize a flowopt queue.
Definition: net.c:297
#define FOR_EACH_KEY_MAP(_i)
Definition: gui.c:34
void sched_monitor_readfd(int fd, struct sched *s)
Instruct the scheduler to monitor an fd for readiness for reading.
Definition: sched.c:498
@ HTTP_SENT_GET_REQUEST
Definition: http_recv.c:30
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:107
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:217
#define GF_SIZE
The largest number in GF(256)
Definition: fec.c:44
int apc_get_pubkey(const char *key_file, struct asymmetric_key **result)
Read an asymmetric key from a file.
Definition: gcrypt.c:426
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:208
const char * version_text(const char *pfx)
Get the full version text.
Definition: string.c:1120
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:81
@ TS_DEAD
Task has been reaped and may be removed from the task list.
Definition: sched.c:27
#define MP3DEC_MAX_FRAME
Definition: mp3dec_filter.c:73
@ 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:81
#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:246
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:408
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:227
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.
Definition: afs.c:957
void print_receiver_helps(bool detailed)
Print out the help texts to all receivers.
Definition: recv_common.c:81
const struct receiver lsg_recv_cmd_com_afh_user_data
Definition: afh_recv.c:241
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:159
void para_block_signal(int sig)
Block a signal for the caller.
Definition: signal.c:174
@ HEADER_LEN_OFFSET
The length of the audio file header (4 bytes).
Definition: aft.c:308
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:131
const char * search_pattern(const uint8_t *pattern, int pattern_len, const char *buf, int buf_size)
Find the first occurrence of the given pattern.
Definition: wma_common.c:24
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:176
__must_check __malloc char * para_strcat(char *a, const char *b)
Paraslash's version of strcat().
Definition: string.c:281
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:183
@ LS_MODE_SHORT
Default listing mode.
Definition: aft.c:69
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:951
__printf_2_3 void(* para_log)(int, const char *,...)
Definition: audioc.c:38
@ AFHI_MAX_CHUNK_SIZE_OFFSET
Size of the largest chunk in bytes.
Definition: aft.c:310
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:384
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:98
#define AFS_CLIENT_TIMEOUT
Shutdown connection if query has not arrived until this many seconds.
Definition: afs.c:869
int task_status(const struct task *t)
Return the status value of a task.
Definition: sched.c:323
uint64_t mp4_get_duration(const struct mp4 *f)
Compute the duration of an mp4 file.
Definition: mp4.c:714
__malloc char * audiod_get_decoder_flags(void)
Return the flags for the decoder_flags status item.
Definition: audiod.c:218
__must_check __malloc void * zalloc(size_t size)
Allocate and initialize memory.
Definition: string.c:96
const struct audio_format_handler wma_afh
The audio format handler for Windows Media Audio.
Definition: wma_afh.c:653
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:97
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:256
struct timeval * vss_chunk_time(void)
Get the chunk time of the current audio file.
Definition: vss.c:168
#define BF(x, y, a, b)
Definition: imdct.c:94
#define VSS_PLAYING
Currently playing.
Definition: vss.h:21
unsigned int vss_repos(void)
Check if a reposition request is pending.
Definition: vss.c:769
#define hex(a)
Return the hex characters of the lower 4 bits.
Definition: string.c:422
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: afh.c:15
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:57
int64_t mp_num_attributes_set(struct mp_context *ctx)
Count the number of attributes set.
Definition: mp.c:329
char * acl_get_contents(struct list_head *acl)
Compute a string containing the contents of an acl.
Definition: acl.c:129
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:657
__must_check __malloc void * arr_alloc(size_t nmemb, size_t size)
Allocate an array, abort on failure or bugs.
Definition: string.c:59
Exported symbols from chunk_queue.c.
void crypt_init(void)
Initialize the crypto backend.
Definition: openssl.c:50
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:86
__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:74
void * ringbuffer_add(struct ringbuffer *rb, void *data)
Add one entry to a ringbuffer.
Definition: ringbuffer.c:61
const char * paraslash_info(void)
Return multi-line version information (license, links, etc.).
__must_check int recv_bin_buffer(int fd, char *buf, size_t size)
Receive data from a file descriptor.
Definition: net.c:768
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:2729
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:102
__malloc char * generic_sender_help(void)
Get the generic help text.
Definition: send_common.c:415
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:348
@ AFS_SOCKET_READY
Socket is inactive.
Definition: vss.c:44
@ AFHI_BITRATE_OFFSET
Position of the bitrate.
Definition: aft.c:298
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:463
void fec_free(struct fec_parms *p)
Deallocate a fec params structure.
Definition: fec.c:435
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:145
int lookup_address(unsigned l4type, bool passive, const char *host, int port_number, struct addrinfo **result)
Resolve an IPv4/IPv6 address.
Definition: net.c:395
void mp_parse_wildcard_pattern(const char *src, struct mp_wc_pattern *result)
Parse a wildcard pattern, including flags.
Definition: mp.c:196
#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:124
@ 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:43
#define OPT_UINT32_VAL(_name, _lpr)
Definition: write.c:28
_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:2467
@ SCF_PARSER_FRIENDLY
Enable parser-friendly output.
Definition: audiod_command.c:54
void sched_monitor_readfd(int fd, struct sched *s)
Instruct the scheduler to monitor an fd for readiness for reading.
Definition: sched.c:498
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:107
const struct audio_format_handler spx_afh
The ogg/speex audio format handler.
Definition: spx_afh.c:256
#define TRANSFORM(a0, a1, a2, a3, wre, wim)
Definition: imdct.c:123
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:14
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:22
Describes the current status of one paraslash sender.
Definition: send.h:169
#define OPT_RESULT(_name)
Definition: afh.c:20
#define FRAME_HEADER_SIZE
Definition: mp3_afh.c:26
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:102
@ LS_SORT_BY_SCORE
-s=s
Definition: aft.c:54
#define OPT_GIVEN(_name)
Definition: audioc.c:33
@ EXEC_DCMD
para or display process running.
Definition: gui.c:61
#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:208
#define WRITE_CMD(_num)
Definition: write.h:55
#define FOR_EACH_BUFFER_REF(_br, _btrn)
Definition: buffer_tree.c:246
struct task * task_register(struct task_info *info, struct sched *s)
Add a task to the scheduler task list.
Definition: sched.c:227
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:230
Public API of the mp4 parser.
void daemon_close_log(void)
Close the log file of the daemon.
Definition: daemon.c:274
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:254
const struct afs_table_operations aft_ops
The audio file table contains information about known audio files.
Definition: aft.c:2729
_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:180
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:428
int top_lines_default
Default number of lines of the top window.
Definition: gui.h:36
#define PARA_INFO_LOG(f,...)
Definition: para.h:221
void sb_free(struct sb_context *c)
Deallocate all memory associated with a sideband handle.
Definition: sideband.c:103
int(* resolve_target)(const char *, struct sender_command_data *)
Resolve target-specific URL string.
Definition: send.h:109
void i9e_complete_option(char *const *opts, struct i9e_completion_info *ci, struct i9e_completion_result *cr)
Complete according to the given options.
Definition: interactive.c:708
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:714
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:50
char * remote_name(int sockfd)
Pretty-printing of IPv4/6 socket addresses.
Definition: net.c:682
const char * stringify_port(int port, const char *transport)
Stringify port number, resolve into service name where defined.
Definition: net.c:216
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:687
unsigned int vss_repos(void)
Check if a reposition request is pending.
Definition: vss.c:769
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:526
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:153
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:292
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:19
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:112
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:213
#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:131
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:356
void * ringbuffer_add(struct ringbuffer *rb, void *data)
Add one entry to a ringbuffer.
Definition: ringbuffer.c:61
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:455
int base64_decode(char const *src, size_t encoded_size, char **result, size_t *decoded_size)
base64-decode a buffer.
Definition: base64.c:80
#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:792
#define OPT_GIVEN(_name)
Definition: audiod.c:42
@ LS_SORT_BY_AUDIO_FORMAT
-s=a
Definition: aft.c:63
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:435
#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:208
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:49
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:747
void sched_min_delay(struct sched *s)
Set the I/O timeout to the minimal possible value.
Definition: sched.c:358
#define PRIVATE_PEM_KEY_HEADER
Private PEM keys (legacy format) start with this header.
Definition: crypt_common.c:257
void generic_com_on(struct sender_status *ss, unsigned protocol)
Activate a paraslash sender.
Definition: send_common.c:281
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: audiod.c:37
struct stream_cipher * recv
Key used for receiving data.
Definition: crypt.h:113
#define CMD_PTR
Definition: gui.c:29
@ 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:517
struct chunk_queue * cq_new(size_t max_pending)
Allocate and initialize a chunk queue.
Definition: chunk_queue.c:129
void cq_destroy(struct chunk_queue *cq)
Deallocate all resources of this queue.
Definition: chunk_queue.c:143
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:112
@ FEC_GROUP_UNUSABLE
Drop the group (because we did not receive the header yet).
Definition: fecdec_filter.c:252
void daemon_drop_privileges_or_die(const char *username, const char *groupname)
Give up superuser privileges.
Definition: daemon.c:348
int sender_num
The number of the sender in question.
Definition: server.h:13
@ COLOR_BOT
Definition: gui.c:79
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:2571
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:47
void imdct(struct mdct_context *ctx, float *output, const float *input)
Compute the inverse MDCT.
Definition: imdct.c:303
int fd
The local socket connecting afs and the command handler.
Definition: afs.h:155
@ LS_SORT_BY_DURATION
-s=d
Definition: aft.c:62
@ ATS_SEEN_MP4A
We have seen an mp4a atom but no subsequent trak atom yet.
Definition: mp4.c:31
#define U32_OPTVAL(_opt, _lpr)
Definition: resample_filter.c:18
int daemonize(bool parent_waits)
Do the usual stuff to become a daemon.
Definition: daemon.c:226
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:75
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:86
size_t vss_get_fec_eof_packet(const char **buf)
Return a buffer that marks the end of the stream.
Definition: vss.c:655
@ AFHI_INFO_STRING_OFFSET
The tag info position.
Definition: aft.c:318
@ AFHI_FREQUENCY_OFFSET
Position of the frequency.
Definition: aft.c:300
#define BLOCK_NB_SIZES
Definition: wmadec_filter.c:38
__malloc struct oac_custom_header * oac_custom_header_new(void)
Allocate and return a custom header structure.
Definition: ogg_afh_common.c:367
void version_handle_flag(const char *pfx, bool flag)
Print the version text and exit successfully.
Definition: string.c:1137
struct lls_parse_result * lpr
Convenience pointer for the deserialized parse result.
Definition: afs.h:168
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:392
void task_notify_all(struct sched *s, int err)
Set the notification value of all tasks of a scheduler instance.
Definition: sched.c:343
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:979
void free_vlc(struct vlc *vlc)
Deallocate all resources of a VLC table.
Definition: bitstream.c:157
afhi_offsets
The on-disk layout of a afhi struct.
Definition: aft.c:294
#define WAV_HEADER_LEN
A wav header is always 44 bytes.
Definition: wav_filter.c:15
const struct filter lsg_filter_cmd_com_prebuffer_user_data
Definition: prebuffer_filter.c:86
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:43
@ HTTP_CONNECTED
We accepted the connection on the tcp socket.
Definition: http_send.c:32
__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:230
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:770
void free_argv(char **argv)
Free an array of words created by create_argv() or create_shifted_argv().
Definition: string.c:740
void crypt_shutdown(void)
Allocate all resources of the crypto backend.
Definition: openssl.c:62
@ FEC_GROUP_USABLE_WITH_HEADER
Use the group, including its header.
Definition: fecdec_filter.c:258
__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:247
Exported functions from vss.c (para_server).
void i9e_complete_option(char *const *opts, struct i9e_completion_info *ci, struct i9e_completion_result *cr)
Complete according to the given options.
Definition: interactive.c:708
@ HTTP_INVALID_GET_REQUEST
We didn't receive a valid get request.
Definition: http_send.c:38
_static_inline_ bool iov_valid(const struct iovec *iov)
Simple sanity check for I/O vectors.
Definition: para.h:123
__printf_2_3 void(* para_log)(int, const char *,...)
Definition: client.c:30
#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:168
int para_accept(int fd, void *addr, socklen_t size, int *new_fd)
Wrapper around the accept system call.
Definition: net.c:820
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:559
@ FEC_STATE_NONE
not initialized and not enabled
Definition: vss.c:123
#define OPT_GIVEN(_name)
Definition: afh.c:21
The standard in task structure.
const struct filter lsg_filter_cmd_com_resample_user_data
Definition: resample_filter.c:277
#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:396
void sb_get_recv_buffer(struct sb_context *c, struct iovec *iov)
Obtain a pointer to the next sideband read buffer.
Definition: sideband.c:180
unsigned ringbuffer_filled(struct ringbuffer *rb)
Get the number of entries in the ring buffer.
Definition: ringbuffer.c:96
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:390
int read_ok(int fd)
Check a file descriptor for readability.
Definition: fd.c:538
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:393
__must_check void * zalloc(size_t size)
Allocate and initialize memory.
Definition: string.c:96
@ AFS_SOCKET_AFD_PENDING
vss wrote a request to the socket and waits for reply from afs.
Definition: vss.c:48
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:131
#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:495
int base64_decode(char const *src, size_t encoded_size, char **result, size_t *decoded_size)
base64-decode a buffer.
Definition: base64.c:80
void btr_pool_free(struct btr_pool *btrp)
Deallocate resources used by a buffer pool.
Definition: buffer_tree.c:88
unsigned int vss_stopped(void)
Check if the vss is currently stopped.
Definition: vss.c:792
void daemon_set_flag(unsigned flag)
Set one of the daemon config flags.
Definition: daemon.c:196
uint16_t mp4_get_channel_count(const struct mp4 *f)
Return the number of channels of the audio track.
Definition: mp4.c:809
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:180
@ 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:147
@ CRT_FILE_CHANGE
New file should be loaded (com_next()).
Definition: play.c:53
#define CHECK_HEADER(_p, _h)
Definition: wma_afh.c:283
int imdct_init(int nbits, struct mdct_context **result)
Initialize the inverse modified cosine transform.
Definition: imdct.c:351
#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:490
@ ASN1_TYPE_BIT_STRING
Bit string object.
Definition: gcrypt.c:129
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:46
char * get_task_list(struct sched *s)
Get the list of all registered tasks.
Definition: sched.c:254
server_command_permissions
Flags for server commands and user permissions.
Definition: user_list.h:13
#define AFSI_SIZE
Definition: upgrade_db.c:127
const struct mixer alsa_mixer oss_mixer
Declared even if unsupported because it does not hurt and avoids ifdefs.
Definition: oss_mix.c:134
void shutdown_client(struct sender_client *sc, struct sender_status *ss)
Shut down a client connected to a paraslash sender.
Definition: send_common.c:44
void afh_close(void *afh_context, uint8_t audio_format_id)
Deallocate resources allocated due to dynamic chunk handling.
Definition: afh_common.c:286
#define FOR_EACH_MAPPED_KEY(i)
Definition: play.c:530
@ LS_SORT_BY_FREQUENCY
-s=f
Definition: aft.c:57
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:430
stat_client_flags
Flags used for the stat command of para_audiod.
Definition: audiod_command.c:52
void print_writer_helps(bool detailed)
Print the help text of all writers to stdout.
Definition: write_common.c:152
@ LS_SORT_BY_LAST_PLAYED
-s=l
Definition: aft.c:55
void signal_shutdown(struct signal_task *st)
Close the write end of the signal pipe, deallocate resources.
Definition: signal.c:232
@ SBD_CHALLENGE
Definition: sideband.h:66
ls_sorting_method
The different sorting methods of the ls command.
Definition: aft.c:52
void daemon_set_priority(int prio)
Renice the calling process.
Definition: daemon.c:327
#define FOR_EACH_CHANNEL(i)
Iterate over all defined mixer channels.
Definition: oss_mix.c:37
@ 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:682
#define OPT_STRING_VAL(_name)
Definition: afh.c:22
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:429
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:188
__malloc char * mp4_get_tag_value(const struct mp4 *f, const char *item)
Return the value of the given tag item.
Definition: mp4.c:1048
int write_ok(int fd)
Check a file descriptor for writability.
Definition: fd.c:555
struct misc_meta_data * mmd
Pointer to shared memory area for communication between para_server and its children.
Definition: server.c:50
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:198
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:146
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:656
@ 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:168
pid_t afs_pid
The process id of the audio file selector process.
Definition: server.c:84
const struct filter lsg_filter_cmd_com_amp_user_data
Definition: amp_filter.c:99
#define FOR_EACH_CHILD_SAFE(_tn, _tmp, _btrn)
Definition: buffer_tree.c:243
#define PARA_MAX(x, y)
Compute the maximum of x and y.
Definition: para.h:39
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:446
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:318
void free_lpr(void)
Deallocate all lopsub parse results.
Definition: server.c:629
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:312
__must_check __malloc void * arr_alloc(size_t nmemb, size_t size)
Allocate an array, abort on failure or bugs.
Definition: string.c:59
void hash_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash of the given input data.
Definition: gcrypt.c:32
void valid_fd_012(void)
Ensure that file descriptors 0, 1, and 2 are valid.
Definition: fd.c:568
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:443
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:544
const char * name
The name of the sender.
Definition: send.h:48
const struct sender dccp_sender
The DCCP sender.
Definition: dccp_send.c:257
_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:105
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:180
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:262
@ CAB_AUDIO_FORMAT_ID_OFFSET
Audio format id.
Definition: aft.c:1571
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:36
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:141
void clear_afhi(struct afh_info *afhi)
Deallocate the contents of an afh_info structure.
Definition: afh_common.c:208
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:170
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:26
int playlist_check_callback(struct afs_callback_arg *aca)
Check the playlist table for inconsistencies.
Definition: playlist.c:91
_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:327
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:821
vss_status_flags
The vss status flags audiod is interested in.
Definition: audiod.c:109
void i9e_attach_to_stdout(struct btr_node *producer)
Prepare writing to stdout.
Definition: interactive.c:173
#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:57
int64_t mp_duration(struct mp_context *ctx)
Return the duration of the audio file from the afh info structure.
Definition: mp.c:401
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:306
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:34
int daemon_get_loglevel(void)
Get the current log level of the daemon.
Definition: daemon.c:162
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:74
void activate_grab_clients(struct sched *s)
Activate inactive grab clients if possible.
Definition: grab_client.c:150
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: play.c:28
@ 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:795
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:91
attribute_table_columns
The columns of the attribute table.
Definition: attribute.c:23
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:541
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:430
int check_wav_post_monitor(struct check_wav_context *cwc)
Filter out the wav header, pushdown everything else.
Definition: check_wav.c:122
void flowopt_cleanup(struct flowopts *fo)
Deallocate all resources of a flowopts structure.
Definition: net.c:362
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:830
@ COLOR_SEPARATOR
Definition: gui.c:77
#define FOR_EACH_CHILD(_tn, _btrn)
Definition: buffer_tree.c:241
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:320
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:40
int string_compare(const struct osl_object *obj1, const struct osl_object *obj2)
Compare two osl objects of string type.
Definition: afs.c:358
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:69
#define RSA_PUBKEY_SEXP
S-expression for the public part of an RSA key.
Definition: gcrypt.c:108
__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:177
void oac_custom_header_flush(struct oac_custom_header *h)
Force remaining packets into an ogg page.
Definition: ogg_afh_common.c:411
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:198
__must_check int mark_fd_blocking(int fd)
Set a file descriptor to blocking mode.
Definition: fd.c:307
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:75
__must_check void * arr_realloc(void *ptr, size_t nmemb, size_t size)
Reallocate an array, abort on failure or bugs.
Definition: string.c:32
size_t btr_pool_size(const struct btr_pool *btrp)
Return the size of the buffer pool area.
Definition: buffer_tree.c:105
__malloc char * get_time_string(void)
Compute the play time based on information of the current slot.
Definition: audiod.c:291
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:212
void hash2_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash2 of the given input data.
Definition: gcrypt.c:48
const char * search_pattern(const uint8_t *pattern, int pattern_len, const char *buf, int buf_size)
Find the first occurrence of the given pattern.
Definition: wma_common.c:24
const struct audio_format_handler flac_afh
The audio format handler for flac (free lossless audio decoder).
Definition: flac_afh.c:521
@ BLOB_RENAME
A blob was renamed.
Definition: afs.h:53
@ CAB_HASH_OFFSET
The hash of the audio file being added.
Definition: aft.c:1573
#define DCCP_SOCKOPT_GET_CUR_MPS
Max packet size, RFC 4340, 14.
Definition: dccp_send.c:96
int handle_connect(int fd)
Perform user authentication and execute a command.
Definition: command.c:921
char * mp_path(struct mp_context *ctx)
Return the full path to the audio file.
Definition: mp.c:284
@ LS_MODE_LONG
-l or -l=l
Definition: aft.c:70
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:255
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:82
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:120
@ 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:158
@ COLOR_COMMAND
Definition: gui.c:73
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:141
#define HANDSHAKE_BUFSIZE
Definition: command.c:842
int recv_buffer(int fd, char *buf, size_t size)
Receive and write terminating NULL byte.
Definition: net.c:792
uint8_t amp
Amplification value.
Definition: afs.h:20
#define RECEIVER(_a)
Definition: audiod.c:94
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:1028
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
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:814
void check_wav_shutdown(struct check_wav_context *cwc)
Dellocate all ressources of a check_wav instance.
Definition: check_wav.c:243
void sched_min_delay(struct sched *s)
Set the I/O timeout to the minimal possible value.
Definition: sched.c:358
void close_stat_clients(void)
Empty the status clients list.
Definition: audiod_command.c:126
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:261
#define FOR_EACH_BUDDY_SAFE(_buddy, _tmp_buddy, _list)
Definition: sync_filter.c:50
void apc_free_pubkey(struct asymmetric_key *pub)
Deallocate a public key.
Definition: openssl.c:357
uint32_t mp4_num_samples(const struct mp4 *f)
Return the number of samples of the audio track.
Definition: mp4.c:821
afsi_offsets
Describes the layout of the mmapped-afs info struct.
Definition: aft.c:129
Bitstream structures and inline functions.
bool process_is_command_handler(void)
Tell whether the executing process is a command handler.
Definition: server.c:97
@ 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:2517
#define OPT_ADD(fo, lev, opt, val, len)
Flowopt shortcut.
Definition: dccp_recv.c:66
unsigned char bitnum
The bit number of the attribute being removed.
Definition: afs.h:63
void * ringbuffer_get(struct ringbuffer *rb, int num)
Get one entry from a ringbuffer.
Definition: ringbuffer.c:81
int grab_client_new(int fd, struct lls_parse_result *lpr, struct sched *s)
Create and activate a grab client.
Definition: grab_client.c:260
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:358
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:537
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:506
struct gui_color_spec sep
Color for the separator line.
Definition: gui.h:56
char * word
The (partial) 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:67
int mp_init(const char *definition, int nbytes, struct mp_context **result, char **errmsg)
Initialize the mood parser.
Definition: mp.c:506
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:183
int open_and_update_audio_file(int *fd)
Open the audio file with highest score and set up an afd structure.
Definition: aft.c:1042
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:312
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:886
void del_close_on_fork_list(int fd)
Delete one file descriptor from the close-on-fork list.
Definition: close_on_fork.c:49
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:224
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:234
#define PARA_DEBUG_LOG(f,...)
Definition: para.h:220
void imdct_end(struct mdct_context *ctx)
Deallocate imdct resources.
Definition: imdct.c:387
#define OPUSDEC_MAX_OUTPUT_SIZE
Definition: opusdec_filter.c:207
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:396
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:234
int handle_connect(int fd)
Perform user authentication and execute a command.
Definition: command.c:921
#define OPT_GIVEN(_cmd, _opt)
Definition: mixer.c:37
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:491
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
#define FOR_EACH_RECEIVER(i)
Definition: recv_common.c:74
time_t daemon_get_uptime(const struct timeval *current_time)
Get the uptime.
Definition: daemon.c:413
__printf_2_3 unsigned xasprintf(char **result, const char *fmt,...)
Print to a dynamically allocated string, variable number of arguments.
Definition: string.c:212
@ ATS_INITIAL
We haven't encountered an mp4a atom so far.
Definition: mp4.c:29
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:559
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:434
#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:212
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:74
_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:111
@ ATOM_ITEMS
Definition: mp4.c:162
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:708
#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:75
#define ENDIAN
Determine byte sex.
Definition: oggdec_filter.c:30
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:35
The tags used by all audio format handlers.
Definition: afh.h:11
#define OPT_RESULT(_name, _lpr)
Definition: write.c:25
int write_all(int fd, const void *buf, size_t len)
Write to a file descriptor, fail on short writes.
Definition: fd.c:141
@ 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:141
@ AFSI_NUM_PLAYED_OFFSET
Storage position of the .num_played field.
Definition: aft.c:135
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:589
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:81
void shutdown_clients(struct sender_status *ss)
Shut down all clients connected to a paraslash sender.
Definition: send_common.c:67
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:759
#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:260
#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:48
void score_clear(void)
Remove all entries from the score table, but keep the table open.
Definition: score.c:318
@ SBD_CHALLENGE_RESPONSE
Definition: sideband.h:66
@ CAB_PATH_OFFSET
Start of the path of the audio file.
Definition: aft.c:1575
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:494
__printf_2_3 void(* para_log)(int, const char *,...)
The log function of para_gui, always set to curses_log().
Definition: mixer.c:62
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:41
struct mp4_metadata * mp4_get_meta(struct mp4 *f)
Return the metadata of an mp4 file.
Definition: mp4.c:866
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:114
int(* audiod_cmd_handler_t)(int, struct lls_parse_result *)
Pointer to a command handler function.
Definition: audiod_command.c:37
int mp4_set_sample_position(struct mp4 *f, uint32_t sample)
Reposition the read/write file offset.
Definition: mp4.c:732
@ AFSI_AMP_OFFSET
Storage position of the amplification field.
Definition: aft.c:143
#define OPT_UINT32_VAL(_name)
Definition: gui.c:33
int fd_flags
The descriptor flags of STDIN at startup.
Definition: stdin.h:14
#define PARA_NOTICE_LOG(f,...)
Definition: para.h:222
void score_close(struct osl_table *t)
Free all volatile objects, then close the table.
Definition: score.c:283
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:438
@ FEC_STATE_READY_TO_RUN
initialized and enabled
Definition: vss.c:125
#define UDP_MAX_UNREACHABLE_TIME
Time window during which ICMP Destination/Port Unreachable messages are ignored, covering transient r...
Definition: udp_send.c:35
@ 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:293
void sched_monitor_writefd(int fd, struct sched *s)
Instruct the scheduler to monitor an fd for readiness for writing.
Definition: sched.c:511
void i9e_print_status_bar(char *buf, unsigned len)
Print the current status to stderr.
Definition: interactive.c:549
@ 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:758
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:2467
@ 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:164
@ CHUNKS_TOTAL_OFFSET
The total number of chunks (4 bytes).
Definition: aft.c:306
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:594
afs_socket_status
The possible states of the afs socket.
Definition: vss.c:42
int para_open(const char *path, int flags, mode_t mode)
Wrapper for the open(2) system call.
Definition: fd.c:379
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:622
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
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:278
#define MAD_TO_SHORT(f)
Convert a sample value from libmad to a signed short.
Definition: mp3dec_filter.c:18
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:292
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:350
#define U32_OPTVAL(_opt, _lpr)
Definition: compress_filter.c:20
@ AFTCOL_HASH
The hash on the content of the audio file.
Definition: upgrade_db.c:114
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:100
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:125
unsigned parse_quoted_string(const char *src, const char quote_chars[2], char **result)
Parse a (generalized) string literal.
Definition: mp.c:83
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:368
@ NUM_LOGLEVELS
Definition: para.h:218
const struct sender udp_sender
The UDP sender.
Definition: udp_send.c:447
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:75
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:408
@ GM_PEDANTIC
Close fd if write would block.
Definition: grab_client.c:29
@ VSS_STATUS_FLAG_PLAYING
The 'P' flag is set.
Definition: audiod.c:113
audio_track_state
The three states of the mp4 parser.
Definition: mp4.c:27
#define WMA_OUTPUT_BUFFER_SIZE
Definition: wmadec_filter.c:975
const struct filter lsg_filter_cmd_com_aacdec_user_data
Definition: aacdec_filter.c:158
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 function for each complete line in a buffer.
Definition: string.c:379
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:198
__a_const int wma_log2(unsigned int v)
Compute the base-2 logarithm.
Definition: wma_common.c:164
#define NUM_INTERNALLY_MAPPED_KEYS
Definition: play.c:528
void clear_afhi(struct afh_info *afhi)
Deallocate the contents of an afh_info structure.
Definition: afh_common.c:208
int i9e_get_error(void)
Return the error state of the i9e task.
Definition: interactive.c:49
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:211
struct queued_chunk * cq_peek(struct chunk_queue *cq)
Lookup the next chunk in the queue.
Definition: chunk_queue.c:69
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:518
#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:211
symbols used by gui and gui_theme
@ LOGLEVELS
Definition: para.h:218
#define CMUL(pre, pim, are, aim, bre, bim)
Definition: imdct.c:240
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:307
void cq_dequeue(struct chunk_queue *cq)
Remove the current chunk from the queue.
Definition: chunk_queue.c:81
void get_random_bytes_or_die(unsigned char *buf, int num)
Fill a buffer with random content.
Definition: gcrypt.c:64
struct mp4_metadata * mp4_get_meta(struct mp4 *f)
Return the metadata of an mp4 file.
Definition: mp4.c:866
__malloc char * format_url(const char *url, int default_port)
Pretty-print a host/port pair.
Definition: net.c:192
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:655
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:40
int create_local_socket(const char *name)
Create a socket for local communication and listen on it.
Definition: net.c:936
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:343
#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:224
void free_argv(char **argv)
Free an array of words created by create_argv() or create_shifted_argv().
Definition: string.c:740
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:72
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:143
char * user
Paraslash user name.
Definition: client.h:42
@ AFTCOL_PATH
The full path in the filesystem.
Definition: upgrade_db.c:116
__must_check int afs_event(enum afs_events event, struct para_buffer *pb, void *data)
The afs event dispatcher.
Definition: afs.c:1165
#define PARA_EMERG_LOG(f,...)
Definition: para.h:226
__must_check void * arr_realloc(void *ptr, size_t nmemb, size_t size)
Reallocate an array, abort on failure or bugs.
Definition: string.c:32
void user_list_deplete(void)
Remove all entries from the user list.
Definition: user_list.c:47
asn1_types
ASN Types and their code.
Definition: gcrypt.c:125
__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:500
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:131
__printf_2_3 int write_va_buffer(int fd, const char *fmt,...)
A fprintf-like function for raw file descriptors.
Definition: fd.c:168
__must_check __malloc void * alloc(size_t size)
Paraslash's version of malloc().
Definition: string.c:132
#define NUM_AUDIO_FORMATS
Definition: audiod.c:49
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:125
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:364
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:53
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:186
void daemon_set_start_time(void)
Set the startup time.
Definition: daemon.c:396
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:128
#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:196
#define MIN_STAT_ITEM_LEN
The minimal length of a status item buffer.
Definition: stat.c:13
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:34
int get_attribute_bitnum_by_name(const char *att_name, unsigned char *bitnum)
Retrieve the identifier (number) of an attribute.
Definition: attribute.c:90
void daemon_set_flag(unsigned flag)
Set one of the daemon config flags.
Definition: daemon.c:196
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:915
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:218
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:85
void check_wav_shutdown(struct check_wav_context *cwc)
Dellocate all ressources of a check_wav instance.
Definition: check_wav.c:243
#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:198
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:27
int imdct_init(int nbits, struct mdct_context **result)
Initialize the inverse modified cosine transform.
Definition: imdct.c:351
int create_argv(const char *buf, const char *delim, char ***result)
Split a buffer into words.
Definition: string.c:795
state_change_request_type
Describes a request to change the state of para_play.
Definition: play.c:47
bool process_is_command_handler(void)
Tell whether the executing process is a command handler.
Definition: server.c:97
@ 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:277
struct pollfd * pfd
Passed to poll(2).
Definition: sched.h:23
@ CAB_AFHI_OFFSET_POS
Definition: aft.c:1565
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:254
struct osl_object query
Callback-specific data.
Definition: afs.h:157
@ HTTP_CONNECTED
Definition: http_recv.c:30
char * title
TIT2/TITLE/nam.
Definition: afh.h:15
const struct filter lsg_filter_cmd_com_oggdec_user_data
Definition: oggdec_filter.c:273
@ 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:173
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:635
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:72
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:32
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:180
int create_local_socket(const char *name)
Create a socket for local communication and listen on it.
Definition: net.c:936
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:377
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:265
char * safe_strdup(const char *src, size_t len)
strdup() for not necessarily zero-terminated strings.
Definition: string.c:860
int hash2_compare(const unsigned char *h1, const unsigned char *h2)
Compare two version 2 hashes.
Definition: crypt_common.c:173
#define CMD_PTR
Definition: write.c:24
@ COLOR_OUTPUT
Definition: gui.c:74
__malloc char * mp4_get_tag_value(const struct mp4 *f, const char *item)
Return the value of the given tag item.
Definition: mp4.c:1048
#define BASE64_MAX_DECODED_SIZE(_encoded_size)
Maximal possible size of the decoded data.
Definition: base64.c:50
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:27
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:98
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:317
const char * filter_name(int filter_num)
Return the name of a filter, given its number.
Definition: filter_common.c:51
const struct afs_table_operations score_ops
The score table stores (aft row, score) pairs in memory.
Definition: score.c:325
Mixer API for para_mixer.
http_client_status
The possible states of a client from the server's POV.
Definition: http_send.c:30
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:158
time_t daemon_get_uptime(const struct timeval *current_time)
Get the uptime.
Definition: daemon.c:413
int64_t mp_year(struct mp_context *ctx)
Parse and return the value of the year tag.
Definition: mp.c:446
#define OPUS_COMMENT_HEADER
Definition: opus_afh.c:17
void daemon_log_welcome(const char *whoami)
Log the startup message containing the paraslash version.
Definition: daemon.c:314
@ AFSI_LAST_PLAYED_OFFSET
Where .last_played is stored.
Definition: aft.c:131
@ 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:1050
@ AFTCOL_CHUNKS
The chunk table info and the chunk table of the audio file.
Definition: aft.c:210
const struct afs_table_operations attr_ops
The attribute table stores name/bitnum pairs.
Definition: attribute.c:493
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:206
__printf_2_3 void(* para_log)(int, const char *,...)
The log function of para_gui, always set to curses_log().
Definition: server.c:41
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:1478
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:143
#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:115
int dccp_available_ccids(uint8_t **ccid_array)
Probe the list of DCCP CCIDs configured on this host.
Definition: net.c:849
#define SIDEBAND_HEADER_SIZE
Each sideband packet consists of a header and a data part.
Definition: sideband.c:12
int hash_compare(const unsigned char *h1, const unsigned char *h2)
Compare two hashes.
Definition: crypt_common.c:148
#define do_nothing
A nice cup of STFU for Mr gcc.
Definition: para.h:186
#define AFH_RECV
Definition: play.c:113
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:38
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:162
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:90
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:670
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:635
__must_check int mark_fd_nonblocking(int fd)
Set a file descriptor to non-blocking mode.
Definition: fd.c:325
@ CRT_REPOS
Stream must be repositioned (com_jmp(), com_ff()).
Definition: play.c:51
void hash_function(const char *data, unsigned long len, unsigned char *hash)
Compute the hash of the given input data.
Definition: openssl.c:522
#define OPT_RESULT(_name)
Definition: gui.c:30
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:477
@ SCORECOL_AFT_ROW
The row of the audio file.
Definition: score.c:47
int mp4_set_sample_position(struct mp4 *f, uint32_t sample)
Reposition the read/write file offset.
Definition: mp4.c:732
const struct user * user_list_lookup(const char *name)
Lookup a user in the user list.
Definition: user_list.c:151
int id
Corresponds to a token type, for example LESS_OR_EQUAL.
Definition: mp.h:72
#define CMD_PTR(_cmd)
Definition: mixer.c:34
const struct audio_format_handler mp3_afh
The mp3 audio format handler.
Definition: mp3_afh.c:701
void freep(void *arg)
Free the content of a pointer and set it to NULL.
Definition: string.c:257
@ VSS_NEW_AUDIO_FILE
The vss streams a new file, implies afsi and afhi change.
Definition: afs.h:43
@ 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:41
int para_regcomp(regex_t *preg, const char *regex, int cflags)
Compile a regular expression.
Definition: string.c:830
int for_each_matching_row(struct pattern_match_data *pmd)
Execute the given function for each matching row.
Definition: afs.c:334
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:97
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:82
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:513
void para_block_signal(int sig)
Block a signal for the caller.
Definition: signal.c:174
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:175
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:234
void stat_client_write_item(int item_num)
Write a message to all connected status clients.
Definition: audiod_command.c:143
void imdct(struct mdct_context *s, float *output, const float *input)
Compute the inverse MDCT.
Definition: imdct.c:303
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:27
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:860
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:979
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:186
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:758
void print_filter_helps(bool detailed)
Print help text of each filter to stdout.
Definition: filter_common.c:120
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:559
#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:177
#define OPT_UINT32_VAL(_name, _lpr)
Definition: upgrade_db.c:19
@ GF_ONE_SHOT
Stop grabbing if audio file changes.
Definition: grab_client.c:35
@ CAB_CHUNKS_OFFSET_POS
Start of the chunk table (if present).
Definition: aft.c:1567
void mp4_close(struct mp4 *f)
Deallocate all resources associated with an mp4 file handle.
Definition: mp4.c:591
#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:30
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:130
char * acl_get_contents(struct list_head *acl)
Compute a string containing the contents of an acl.
Definition: acl.c:129
#define MAP_POPULATE
As of 2018, neither FreeBSD-11.2 nor NetBSD-8.0 have MAP_POPULATE.
Definition: vss.c:949
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:380
@ AFTCOL_AFHI
The audio format handler info.
Definition: aft.c:208
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:55
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:180
#define OPT_UINT32_VAL(_cmd, _opt)
Definition: mixer.c:39
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:255
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:175
@ 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:223
#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:48
int para_reap_child(pid_t *pid)
Reap one child.
Definition: signal.c:98
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:718
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:491
int lookup_address(unsigned l4type, bool passive, const char *host, int port_number, struct addrinfo **result)
Resolve an IPv4/IPv6 address.
Definition: net.c:395
@ 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:34
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:39
bool uid_is_whitelisted(uid_t uid)
Lookup the given UID in the whitelist.
Definition: audiod.c:1410
int task_reap(struct task **tptr)
Obtain the error status of a task and deallocate its resources.
Definition: sched.c:168
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:436
#define dump_buffer(a, b, c)
Empty.
Definition: gcrypt.c:29
int n
Total number of codes.
Definition: wmadata.h:27
DEFINE_PARA_ERRLIST
Array of error strings.
Definition: write.c:22
#define DIV_ROUND_UP(x, y)
Divide and round up to next integer.
Definition: para.h:139
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:33
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:288
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:156
void playlist_unload(struct playlist_instance *pi)
Free all resources of the given/current playlist.
Definition: playlist.c:103
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:47
int score_update(const struct osl_row *aft_row, long new_score)
Replace a row of the score table.
Definition: score.c:135
Structure passed to the AFS max_size handler.
Definition: afs.h:197
exec_status
Type of the process currently being executed.
Definition: gui.c:59
void free_sender_status(const struct sender_status *ss)
Deallocate all resources allocated in init_sender_status().
Definition: send_common.c:165
void sched_request_timeout(struct timeval *to, struct sched *s)
Impose an upper bound for the I/O timeout.
Definition: sched.c:374
@ LS_SORT_BY_BITRATE
-s=b
Definition: aft.c:61
@ LS_MODE_VERBOSE
Definition: aft.c:71
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:334
task_status
The possible states of a task.
Definition: sched.c:25
@ CHUNK_TV_TV_USEC_OFFSET
The microseconds part of the chunk time (4 bytes).
Definition: aft.c:314
__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:180
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:271
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:236
uint64_t attributes
Bit field of set attributes.
Definition: afs.h:10
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:302
__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:500
int default_timeout
Initial value (in milliseconds) before any pre_monitor call.
Definition: sched.h:19