import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
parent
3729fc68eb
commit
423ba10303
13396 changed files with 269468 additions and 0 deletions
20
software/cinit/browse_source/cinit-0.3pre9/src/comm/README
Normal file
20
software/cinit/browse_source/cinit-0.3pre9/src/comm/README
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
All abstracted communication functions. Do not depend on the underlying
|
||||
inter process communication mechanism.
|
||||
|
||||
- send_command(): client function: sends a command to cinit
|
||||
- send_service(): client function: send the service name to operate on
|
||||
|
||||
- read_command(): server function: reads beginning of a command
|
||||
* Extracts the command
|
||||
* reads client identification (=pid)
|
||||
* calls other functions, depending on the command send => switch()
|
||||
- read_service(): server function: reads service
|
||||
|
||||
- write_answer(): server function: answer?
|
||||
* sends answers to clients => senseful?
|
||||
|
||||
|
||||
TODO:
|
||||
- define information function, that returns various information about
|
||||
a service
|
||||
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
/***********************************************************************
|
||||
*
|
||||
* 2007 Nico Schottelius (nico-cinit at schottelius.org)
|
||||
*
|
||||
* part of cLinux/cinit
|
||||
*
|
||||
* cinit reads a command sent by a client, called by ipc listener
|
||||
*
|
||||
*/
|
||||
|
||||
#include "comm.h" /* message struct definition */
|
||||
#include "reboot.h" /* reboot abstraction layer */
|
||||
|
||||
int read_command(struct s_cmd cmd)
|
||||
{
|
||||
switch(cmd.cmd) {
|
||||
case CMD_SVC_START:
|
||||
break;
|
||||
|
||||
case CMD_SVC_START_ONLY:
|
||||
break;
|
||||
|
||||
case CMD_SVC_START_NEEDS:
|
||||
break;
|
||||
|
||||
case CMD_SVC_STOP:
|
||||
break;
|
||||
|
||||
case CMD_SVC_STOP_ONLY:
|
||||
break;
|
||||
|
||||
case CMD_SVC_STOP_WANTS
|
||||
break;
|
||||
|
||||
/* halt/shutdown/poweroff */
|
||||
case CMD_HALT:
|
||||
cinit_do_halt();
|
||||
break;
|
||||
|
||||
case CMD_REBOOT:
|
||||
cinit_do_halt();
|
||||
break;
|
||||
|
||||
case CMD_POWEROFF:
|
||||
cinit_do_poweroff();
|
||||
break;
|
||||
|
||||
/* return error to client */
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
/***********************************************************************
|
||||
*
|
||||
* 2007 Nico Schottelius (nico-cinit at schottelius.org)
|
||||
*
|
||||
* part of cLinux/cinit
|
||||
*
|
||||
* A client sends a command to cinit
|
||||
*/
|
||||
|
||||
#include "comm.h" /* message struct definition */
|
||||
|
||||
send_command(struct s_cmd cmd)
|
||||
{
|
||||
/* cinit_ipc_to_server() */
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue