Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
dpidc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <errno.h>
#include "../dlib/dlib.h"
#include "../dpip/dpip.h"
Include dependency graph for dpidc.c:

Go to the source code of this file.

Macros

#define MSG_ERR(...)   printf("** ERROR **: " __VA_ARGS__);
 

Functions

static void print_usage (const char *prgname)
 
static void error (char *msg)
 
static int Dpi_read_comm_keys (int *port)
 Read dpid's communication keys from its saved file.
 
int main (int argc, char *argv[])
 

Variables

char * CMD_REGISTER = "<cmd='register_all' '>"
 
char * CMD_STOP = "<cmd='DpiBye' '>"
 
static char SharedKey [32]
 

Macro Definition Documentation

◆ MSG_ERR

#define MSG_ERR (   ...)    printf("** ERROR **: " __VA_ARGS__);

Definition at line 26 of file dpidc.c.

Function Documentation

◆ Dpi_read_comm_keys()

static int Dpi_read_comm_keys ( int *  port)
static

Read dpid's communication keys from its saved file.

Return value: 1 on success, -1 on error.

Definition at line 49 of file dpidc.c.

References dFree(), dGethomedir(), dGetline(), dStrconcat(), dStrerror, MSG_ERR, and SharedKey.

Referenced by main().

◆ error()

static void error ( char *  msg)
static

Definition at line 39 of file dpidc.c.

Referenced by a_Misc_mkfname(), Bms_load(), Dns_server(), dw::Trie::load(), and main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 73 of file dpidc.c.

References CMD_REGISTER, CMD_STOP, dClose(), Dpi_read_comm_keys(), error(), MSG_ERR, print_usage(), and SharedKey.

◆ print_usage()

static void print_usage ( const char *  prgname)
static

Definition at line 33 of file dpidc.c.

Referenced by main().

Variable Documentation

◆ CMD_REGISTER

char* CMD_REGISTER = "<cmd='register_all' '>"

Definition at line 28 of file dpidc.c.

Referenced by main().

◆ CMD_STOP

char* CMD_STOP = "<cmd='DpiBye' '>"

Definition at line 29 of file dpidc.c.

Referenced by main().

◆ SharedKey

char SharedKey[32]
static

Definition at line 31 of file dpidc.c.

Referenced by Dpi_read_comm_keys(), and main().