#include <stdio.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include "cctalk-channel-defs.h"
#include "cctalk-operations.h"
#include "cctalk-channel.h"
#include "cctalk-pkts.h"
#include "cctalk-pkt-utls.h"
#include "cctalk-svr-mem.h"
#include "cctalk-socket.h"
#include "cctalk-server.h"
#include "cctalk-debug.h"
Include dependency graph for cctalk-server.c:

Defines | |
| #define | CCTALK_TIME_UNIT (10000) /* 10mS */ |
| #define | CCTS_CAN_BECOME_SERVER 1 |
| Used to allow the cctalk server to fork or not. | |
Functions | |
| void | ccts_GetPackets (void) |
| Receive packets to be processed. | |
| void | ccts_ReceivePkt2Process (int fdHandle) |
| We have received the start packet magic number process the packet. | |
| teCCTALK_ERRORS | ccts_ProcessCommandPkt (tsCCT_PKT_CHANNEL_CMD *psCctCmdPkt, int fd) |
| So the packet received was a command packet action it. | |
| void | ccts_SendErrorReturnPacket (int fdSock, teCCTALK_ERRORS eErr) |
| Send an error return packet to the client. | |
| void | ccts_ReceiveCctalkOperation (int fdSock, teCCTALK_CHANNEL eCctCh) |
| After receiving a cctalk operation processed request send a reply. | |
| void | ccts_ProcessCommandLine (int argc, char *argv[]) |
| Read and process the command line arguments. | |
| void | ccts_ProcessMain (void) |
| This is the guts of main. | |
| int | ccts_DaemonInit (void) |
| Fork off a new process and cause the parent to exit but the child lives on. | |
| int | main (int argc, char *argv[], char *env[]) |
| Server entry point. | |
Variables | |
| char ** | pacEnvoriment |
| char * | pacCmdLineNames [] |
| int | zlMaxFds |
| int | zlqKeepRunning = 0 |
| int | qBecomeServer = 0 |
| char | acSocketToOpen [100] = "/dev/cctalk" |
|
|
Used to allow the cctalk server to fork or not. If DEBUG is set in the makefile that the server process will not fork ever. But some debugging information is printed out by the server to check memory usage. |
|
|
Fork off a new process and cause the parent to exit but the child lives on. Called when running detached from the console. This function will fork off a new process returning the child process and exit from the parent process.
History |
|
|
Receive packets to be processed.
History |
Here is the call graph for this function:

|
||||||||||||
|
Read and process the command line arguments. Process the command line arguments passed from the command line to the cctalk server.
History |
|
||||||||||||
|
So the packet received was a command packet action it. OK so we received a command packet so figure what the command was perform the command and return the result to the client.
History |
Here is the call graph for this function:

|
|
This is the guts of main. This is the main process for the cctalk server. This server will control cctalk operations over many ttyS's and allow many clients to connect to it. This function exists because this server can run in two modes. The first mode is as a standard process that takes a whole console and outputs debugging information to the console. The other operational mode is as a detached server that splits itself from the console an runs in the background.
History |
Here is the call graph for this function:

|
||||||||||||
|
After receiving a cctalk operation processed request send a reply.
History |
Here is the call graph for this function:

|
|
We have received the start packet magic number process the packet. The server has just received a packet to process to start processing the packet. Receive the rest of the header and then figure out what sort of packet it is then read the rest of the packet.
History |
Here is the call graph for this function:

|
||||||||||||
|
Send an error return packet to the client. No matter what the operation the client has to know how it went so an error reply packet is sent to inform the client what happened.
History |
Here is the call graph for this function:

|
||||||||||||||||
|
Server entry point. This is the main cctalk server program entry point
History |
Here is the call graph for this function:

|
|
Name of the socket to use for client server communication |
|
|
Initial value:
{
"--become-server",
"--use-socket",
NULL
}
|
|
|
global pointer to the environment |
|
|
To fork or not to fork this is the answer |
|
|
The maximum file handles a process can open |
|
|
Used to keep the main loop running |
1.3.6