the paraslash-0.4.4 release tarball
[paraslash.git] / server.h
index 73f27c78a1dd1650815d855840fd248b783d0f0a..43ba841d28681fc06b92c06d7ccfce95a3a6423f 100644 (file)
--- a/server.h
+++ b/server.h
@@ -1,32 +1,17 @@
 /*
- * Copyright (C) 1997-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2010 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
 /** \file server.h Common server data structures. */
 
-
 /** Size of the selector_info and audio_file info strings of struct misc_meta_data. */
 #define MMD_INFO_SIZE 16384
 
-/**
- * Defines one command of para_server.
- */
-struct server_command {
-       /** The name of the command. */
-       const char *name;
-       /** Pointer to the function that handles the command. */
-       int (*handler)(int, int, char * const * const);
-       /** The privileges a user must have to execute this command. */
-       unsigned int perms;
-       /** One-line description of the command. */
-       const char *description;
-       /** Summary of the command line options. */
-       const char *usage;
-       /** The long help text. */
-       const char *help;
-};
+/** The maximum length of the host component in an URL */
+#define MAX_HOSTLEN    256
+
 
 /** Holds the arguments for the para_server's sender command. */
 struct sender_command_data{
@@ -35,11 +20,17 @@ struct sender_command_data{
        /** The number of the sender in question. */
        int sender_num;
        /** Used for the allow/deny/add/remove subcommands. */
-       struct in_addr addr;
+       char host[MAX_HOSTLEN];
        /** Used for allow/deny. */
        int netmask;
        /** The port number for add/remove. */
        int port;
+       /** Maximal slice size. */
+       uint16_t max_slice_bytes;
+       /** Number of data slices plus redundant slices. */
+       uint8_t slices_per_group;
+       /** Number of slices minus number of redundant slices. */
+       uint8_t data_slices_per_group;
 };
 
 /**
@@ -92,8 +83,8 @@ struct misc_meta_data {
        unsigned int num_connects;
        /** The number of connections currently active. */
        unsigned int active_connections;
-       /** The process id of para_server. */
-       pid_t server_pid;
+       /** The process id of the audio file selector. */
+       pid_t afs_pid;
        /** This gets updated by afs and contains its current mode. */
        char afs_mode_string[MAXLINE];
        /** Used by the sender command. */
@@ -105,9 +96,5 @@ struct misc_meta_data {
 /** Command line options for para_server. */
 extern struct server_args_info conf;
 
-/** Socket for afs-server communication. */
-extern int afs_socket;
-
 __noreturn void handle_connect(int fd, const char *peername);
-void mmd_unlock(void);
-void mmd_lock(void);
+void parse_config_or_die(int override);