TwiceAsNice
2019-02-18
|
#include "config.h"
#include "fq.h"
#include "indiapi.h"
#include "indidevapi.h"
#include "lilxml.h"
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <netdb.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/socket.h>
Classes | |
struct | Msg |
struct | Property |
struct | ClInfo |
struct | DvrInfo |
Macros | |
#define | INDIPORT 7624 /* default TCP/IP port to listen */ |
#define | REMOTEDVR (-1234) /* invalid PID to flag remote drivers */ |
#define | MAXSBUF 512 |
#define | MAXRBUF 49152 /* max read buffering here */ |
#define | MAXWSIZ 49152 /* max bytes/write */ |
#define | DEFMAXQSIZ 128 /* default max q behind, MB */ |
#define | DEFMAXSSIZ 5 /* default max stream behind, MB */ |
#define | DEFMAXRESTART 10 /* default max restarts */ |
Functions | |
static void | logStartup (int ac, char *av[]) |
static void | usage (void) |
static void | reapZombies (void) |
static void | noSIGPIPE (void) |
static void | indiFIFO (void) |
static void | indiRun (void) |
static void | indiListen (void) |
static void | newFIFO (void) |
static void | newClient (void) |
static int | newClSocket (void) |
static void | shutdownClient (ClInfo *cp) |
static int | readFromClient (ClInfo *cp) |
static void | startDvr (DvrInfo *dp) |
static void | startLocalDvr (DvrInfo *dp) |
static void | startRemoteDvr (DvrInfo *dp) |
static int | openINDIServer (char host[], int indi_port) |
static void | shutdownDvr (DvrInfo *dp, int restart) |
static int | isDeviceInDriver (const char *dev, DvrInfo *dp) |
static void | q2RDrivers (const char *dev, Msg *mp, XMLEle *root) |
static void | q2SDrivers (DvrInfo *me, int isblob, const char *dev, const char *name, Msg *mp, XMLEle *root) |
static int | q2Clients (ClInfo *notme, int isblob, const char *dev, const char *name, Msg *mp, XMLEle *root) |
static int | q2Servers (DvrInfo *me, Msg *mp, XMLEle *root) |
static void | addSDevice (DvrInfo *dp, const char *dev, const char *name) |
static Property * | findSDevice (DvrInfo *dp, const char *dev, const char *name) |
static void | addClDevice (ClInfo *cp, const char *dev, const char *name, int isblob) |
static int | findClDevice (ClInfo *cp, const char *dev, const char *name) |
static int | readFromDriver (DvrInfo *dp) |
static int | stderrFromDriver (DvrInfo *dp) |
static int | msgQSize (FQ *q) |
static void | setMsgXMLEle (Msg *mp, XMLEle *root) |
static void | setMsgStr (Msg *mp, char *str) |
static void | freeMsg (Msg *mp) |
static Msg * | newMsg (void) |
static int | sendClientMsg (ClInfo *cp) |
static int | sendDriverMsg (DvrInfo *cp) |
static void | crackBLOB (const char *enableBLOB, BLOBHandling *bp) |
static void | crackBLOBHandling (const char *dev, const char *name, const char *enableBLOB, ClInfo *cp) |
static void | traceMsg (XMLEle *root) |
static char * | indi_tstamp (char *s) |
static void | logDMsg (XMLEle *root, const char *dev) |
static void | Bye (void) |
int | main (int ac, char *av[]) |
static void | zombieRaised (int signum, siginfo_t *sig, void *data) |
static DvrInfo * | allocDvr () |
Variables | |
struct { | |
const char * name | |
int fd | |
} | fifo |
static ClInfo * | clinfo |
static int | nclinfo |
static DvrInfo * | dvrinfo |
static int | ndvrinfo |
static char * | me |
static int | port = INDIPORT |
static int | verbose |
static int | lsocket |
static char * | ldir |
static int | maxqsiz = (DEFMAXQSIZ * 1024 * 1024) |
static int | maxstreamsiz = (DEFMAXSSIZ * 1024 * 1024) |
static int | maxrestarts = DEFMAXRESTART |
static int | terminateddrv = 0 |
#define DEFMAXRESTART 10 /* default max restarts */ |
#define INDIPORT 7624 /* default TCP/IP port to listen */ |
#define MAXRBUF 49152 /* max read buffering here */ |
#define MAXSBUF 512 |
#define MAXWSIZ 49152 /* max bytes/write */ |
#define REMOTEDVR (-1234) /* invalid PID to flag remote drivers */ |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int main | ( | int | ac, |
char * | av[] | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int fd |
struct { ... } fifo |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
const char* name |
|
static |
|
static |
|
static |
|
static |
|
static |