summaryrefslogtreecommitdiff
path: root/client.h (follow)
Commit message (Collapse)AuthorAge
* Switch to SPDX identifiers.Andre Noll2026-03-17
| | | | | | | | Generated with sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h followed by manually tweaking the result a bit. No license change intended.
* Remove loglevel argument of client_parse_config().Andre Noll2025-09-13
| | | | | | | There are two callers, one in client_common.c and one in client.c. The former passes NULL, hence does not need the argument. The latter passes a non-NULL pointer to initialize the global client_loglevel integer, but this initialization can as well be done in the caller, simplifying the code a bit.
* Remove loglevel argument of client_open().Andre Noll2025-09-13
| | | | Both callers pass NULL.
* client: Remove unused ->config_file member.Andre Noll2018-03-30
| | | | | Currently we store a copy of the config file path in the client task structure for no reason at all. Remove it.
* Shorten copyright notice.Andre Noll2017-09-22
| | | | | | | | | | | | | | | | | | | | | The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
* Convert para_client to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | This replaces the gengetopt command line parser for para_client by a lopsub suite and links para_client against the lopsub library. The ggo file for para_client was the last user of m4/gengetopt/complete.m4, so this file can be removed. The tricky part is create_merged_lpr(), which replaces make_client_argv(). It is called from the i9e line handler and from the completers. The new function merges the original parse result with the arguments given at the command line to produce the parse result stored in the client task structure. The completers no longer duplicate the possible options each server subcommand because the header file generated by lopsubgen exposes an array of string literals which is suitable as the opts argument of i9e_complete_option().
* Update year in copyright headers.Andre Noll2015-01-12
| | | | | | | | | | | | | | | | Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
* doc: Change email address to maan@tuebingen.mpg.deAndre Noll2014-08-18
| | | | | | | | | | | | | | The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
* task_register() conversion: client taskAndre Noll2014-05-25
|
* Remove client_disconnect().Andre Noll2014-05-03
| | | | | | | | | | | | | | | | | | | | | | | | Everything this function does can be done as well when the task terminates by returning negative in ->post_select(). This also avoids to leak the stream cipher structure of the previous connection when running in interactive mode. 1,032 bytes in 1 blocks are definitely lost in loss record 61 of 85 at 0x402994A: malloc (vg_replace_malloc.c:263) by 0x804C689: para_malloc (string.c:71) by 0x804FF87: sc_new (crypt.c:268) by 0x804E204: client_post_select (client_common.c:370) by 0x804D203: schedule (sched.c:59) by 0x804A2E7: main (client.c:500) 1,032 bytes in 1 blocks are definitely lost in loss record 62 of 85 at 0x402994A: malloc (vg_replace_malloc.c:263) by 0x804C689: para_malloc (string.c:71) by 0x804FF87: sc_new (crypt.c:268) by 0x804E217: client_post_select (client_common.c:371) by 0x804D203: schedule (sched.c:59) by 0x804A2E7: main (client.c:500)
* Change copyright year to 2014.Andre Noll2014-02-22
| | | | | | | | | This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
* Allow addblob commands to create output.Andre Noll2013-04-03
| | | | | | | | | | | | | | Currently all addblob commands remain silent even on fatal errors because para_client either reads the command output, or sends its stdin, but never both. This patch overcomes this shortcoming. It makes para_client create two buffer trees instead of one. The client states CL_SENT_COMMAND and CL_RECEIVING are replaced by a single CL_EXECUTING state. Blob data is now sent as a sideband packet. The change breaks compatibility with earlier 0.4.x versions again, but that's OK as this is 0.5.0 material anyway.
* client: Remove sb-compatibility code.Andre Noll2013-04-01
| | | | | Now that non-client sideband connection attempts are rejected up-front, we may get rid of all the non-sideband code.
* Change copyright year to 2013.Andre Noll2013-03-25
| | | | Better late than never.
* trivial: Fix typo in client.h.Andre Noll2013-02-10
|
* Use sideband also for challenge response.Andre Noll2012-05-05
| | | | | | | | | | | | | | | | This changes server and client to exchange the challenge response as a sideband packet if both ends support sideband connections. The SBD_CHALLENGE_RESPONSE designator is used for this purpose. On the client side the changes are less intrusive due to an additional cleanup of the state handling. During connection setup the client's idea of the state of the connection is monitored in the ->status variable of struct client_task. If the client is in the CL_SENT_AUTH state, it receives the challenge and sends the hash of the decrypted challenge back to the server. Either operation may fail, and it seems cleaner to separate the two. So this patch adds the new state CL_RECEIVED_CHALLENGE. The clients enters this state once it decrypted the received challenge.
* Implement client-server feature negotiation.Andre Noll2012-05-05
| | | | | | | | | | The server announces a list of supported features and the client may request any subset of features. The only supported feature is "sideband". It has no effect at the moment but this will change in subsequent patches. TODO: Documentation, remove "foo" feature.
* Change year in copyright message to 2012.Andre Noll2012-01-07
|
* client: Split client_open() and client_close().Andre Noll2011-11-20
| | | | | | | | | | | | | | | | | | | | | | | For interactive para_client sessions, we set up the client configuration from the values given at the command line and in the config file just as we do for non-interactive mode. However, in interactive mode we must be able to execute arbitrary many client commands using the same configuration. client_open() sets up the configuration from the command line arguments and client_close() destroys the configuration, so both functions do more than what is needed in interactive mode. This patch splits client_open() into two functions client_parse_config() and client_connect(). The old client_open() remains with the same semantics as before, it just calls both of the new functions(). In the same spirit, client_close() is split into client_disconnect(), which closes the file descriptor and deallocates the ressources of the current command but does not free the configuration. This allows to re-use the client configuration multiple times for interactive sessions.
* sched: Allow more than one running scheduler instance.Andre Noll2011-11-20
| | | | | | | | | | | | | | | | The interactive completion code must be able to run a second, independent scheduler instance for generating the possible completions. This is currently not possible because the pre_select and post_select list heads of the scheduler are defined globally in sched.c. This patch moves these list heads from sched.c to struct sched. This leaves only the global "now" variable in sched.c, but it is OK to update this from all scheduler instances, so it can stay. Moving the two list heads to struct sched requires that several public functions, among them register_task(), grow an additional parameter. The (mostly trivial) changes that update all callers to provide the new argument make the patch rather invasive, unfortunately.
* Add/fix some doxygen comments.Andre Noll2011-08-09
|
* Rename struct rc4_context and stream cipher send/receive functions.Andre Noll2011-03-27
| | | | | | | This only changes the name structures and functions. Unfortunately, the patch is rather large since it requires to fixup all callers of the affected functions. However, each change is either a simple rename or a trivial documentation adjustment.
* Replace direct use of RC4 by stream cipher abstraction.Andre Noll2011-03-27
| | | | | | | | | | | This introduces the new struct stream_cipher in crypt.h as well as two functions stream_cipher_new() and stream_cipher_free() which initialize a new stream cipher structure and deallocate such a structure, respectively. The users of RC4 are changed to call the new abstract functions, so they become independent from openssl. Consequently the affected files need no include openssl/rc4.h any more.
* Replace 2010 in copyright message by 2011.Andre Noll2011-01-17
|
* Change year in COPYRIGHT to 2010.Andre Noll2010-04-05
| | | | Hey, this is earlier than last year :)
* btr support for para_client.Andre Noll2010-01-15
| | | | | | | | | | The use of the client code in audiod requires a node to be inserted as the _parent_ of some existing node, which was not neccessary before. Therefore a new btrn pointer for the child node is added to struct btr_node_description and btr_new_node() is adjusted accordingly. The patch also adds a small helper sched_request_barrier() to the scheduler.
* client.h: Cosmetics.Andre Noll2009-12-20
|
* Remove unused field challenge_nr from struct client_task.Andre Noll2009-07-19
| | | | A relict from 0.3.x.
* Make rc4 encryption/decryption more explicit.Andre Noll2009-06-14
| | | | | | | | | | | | | | | | | The old code used a rather fancy way to (de)activate encryption on a per fd basis: In net.c there was an array of rc4 keys, indexed by fd. This is rather wastful because the array size is determined by the highest fd for which encryption is activated. It's also hard to comprehend and it's easy to get strange results if one forgets to deactivate the encryption after the fd is closed. This patch introduces a new structure, rc4_context, which consists of an fd and the needed rc4 keys. Users explicitly call the new rc4 variants of the receving/sending functions which take a pointer to a struct rc4_context instead of a file descriptor but are otherwise identical. Keep crypt simple!
* [client] Dynamically allocate output buffer.Andre Noll2009-04-29
| | | | | This should simplify subsequent patches that allow variable-sized output buffers for filters/receivers.
* Fix para_client's --loglevel option.Andre Noll2009-01-24
| | | | Without this fix, para_client always used loglevel debug.
* Change year of copyright from 2008 to 2009.Andre Noll2009-01-10
|
* Simplify the scheduling code.Andre Noll2008-03-30
| | | | | | | | | | | | | | | | | | | | | | - Get rid of sched->select_ret. Tasks shouldn't care about the return value of the select call. - Kill task->private_data. Use container_of() instead. - Remove task->event_handler. It is never necessary and only makes the code more convoluted. The scheduler unregisters tasks as soon as either the pre_select or the post_select functions return an error. - Rename task->ret to task->error and get rid of a couple of error fields in other structs that usually only contained a copy of the task's error value. This conversion likely introduces many bugs that have to be shaken out in subsequent patches. Hopefully it will result in less error-prone code in the long run.
* Change year in Copyright comment from 2007 to 2008.Andre Noll2008-01-08
|
* Make client_pre_select() and client_post_select() static.Andre Noll2007-12-22
| | | | Move functions around a bit to avoid forward-declarations.
* Fix para_client hangs.Andre Noll2007-12-22
| | | | | | In the client event handler we have to set the eof variable to a negative value in order to shut down the stdout task. Rename eof to error while at it.
* Replace eof by error in receivers/filters/writers.Andre Noll2007-12-15
| | | | | | | | | | This way it's possible to tell at a later time why the receiver/filter/writer terminated. This allows to increase the delay for reconnecting in case the receiver failed to connect to para_server: Let the receivers set the error value to -E_RECV_EOF in case a normal end of file event occurred and check this value when calculating the restart barrier.
* replace standard GPL header by a one-line pointer to COPYINGAndre Noll2007-06-28
|
* add more missing documentationAndre Noll2007-02-10
|
* client: combine client_open() and client_parse_config()Andre Noll2007-02-04
| | | | | | | | | | | | | | | | | | | | Both users (client.c and audiod.c) called client_open() right after calling client_parse_config(), so call client_open() from client_parse_config() and make client_open() static. While we're at it, rename client_open() to client_connect() as this is what the function does. Also rename client_parse_config() to client_open() and change audiod.c and client.c to call client_open() instead of client_parse_config(). This patch fixes a segfault in para_client was it was run without specifying a command. In this case, the private client data struct was used by para_log after being freed -- Ouch. Fortunately, this bug didn't affect para_audiod as it never calls these functions with no command. Another bug due to a typo in client_close() is also fixed. This code needs closer investigation and lacks documentation btw.
* doxify client.hAndre2006-06-15
| | | | and add documentation for enable_crypt() and enable_crypt().
* split client.cAndre2006-06-15
new file: client.h new file: client_common.c This completes the preparations for including para_client into para_audiod. client_common.c contains all functions that are also useful for para_audiod.