summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
Commit message (Collapse)AuthorAgeFilesLines
* irmd: reg/unreg whatevercast namesdimitri staessens2016-04-221-30/+254
| | | | | | | | | | | | Unregistering ap's now works. An AP now registers/unregisters its AP-I by sending its AP name and its pid to the IRMd. The IPCPs register whatevercast names. An AP name is currently mapped on a whatevercast name represented by the same string literal. The IRMd allows registration of only one AP-I per AP. A Name Space Management system is needed in the processing system so we can resolve this completely. Changing the stack to register whatevercast names required some changes all over the ipcpd implemented and in the library.
* ipcpd: fixes comments on 18c5da3dimitri staessens2016-04-211-1/+1
|
* irmd: application registrationdimitri staessens2016-04-211-1/+53
| | | | | | Initial code for application registration. Specifying "*" will (for now) register with the first IPCP available in the system. Modified the echo server not to barf messages on failed accept()
* shim-udp: flow allocation addeddimitri staessens2016-04-191-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the API for flow allocation. The shims currently does the following. The shim IPCP binds to an interface (IP address) and listens for flow allocation requests on UDP port 0x0D1F (3359), referenced as the listen port (lp). It will treat any datagram received on lp as a flow allocation request. Upon receiving an allocation request IRM_MSG_CODE__IPCP_FLOW_ALLOC from the IRMd, the shim IPCP will bind a UDP socket to a port (cp) allocated by the host OS. From that port it will send a UDP packet containing the destination ap_name to server_host:lp and wait for a response. Upon reception of a packet on server_host:lp, the shim_IPCP creates a UDP socket for the flow with a port set by the host os (sp), binds to it and echoes the received datagram back from server_host:sp to client_host:cp. It will also notify the IRMd of an incoming flow allocation request IRM_MSG_CODE__IPCP_FLOW_REQ_ARR, with as src_ap_name ("John Day"). It will get the port_id as a return value of that message and create a flow with status FLOW_PENDING with that port_id. If the server responds negatively to the flow allocation request (i.e. the shim IPCP on the server side receives a IRM_MSG_CODE__IPCP_FLOW_ALLOC_RESPONSE with a response != 0, it will delete the pending flow. If response == 0, it will set the status to FLOW_ALLOCATED. On the client machine the IPCP will learn sp upon reception of the echoed datagram. It will then create a flow with the port_id it received with the message from the IRMd and set it to ALLOCATED. Pending implementation: DNS support, this PR only supports local flows on the loopback adapter 127.0.0.1. A thread to listen for the echoed message, to avoid the entire IPCP to block when the echoed message is lost. This PR compiles but is untested pending necessary implementations elsewhere in the stack.
* ipcpd: initial IPC processesdimitri staessens2016-04-181-5/+44
| | | | | | | | | | | Basic functions for implementation of IPC processes, and implementation of core functions of the shim IPCP over UDP. Updates to the build system to compile these IPC processes, as well as some fixes in the irmd (rudimentary capturing exit signals) and some fixes in the library, mainly relating to the messaging. Basic implementation of creation / bootstrapping / deletion of the shim UDP. Placeholders for other functions.
* lib, irmd, irm: Add dif_configSander Vrijders2016-04-081-5/+6
| | | | | | | | | This adds dif_config to the prototype, in which one is able to specify the parameters a DIF should have. The bootstrap operation of an IPCP takes this as parameter and is oblivious to whether it is a shim or a normal IPCP. The dif_config struct is also correctly serialized and deserialized and passed opaquely to the correct IPCP. This IPCP is in charge of deserializing it correctly.
* irmd: Rename name_to_pid to ipcp_dataSander Vrijders2016-04-021-31/+75
| | | | | | Did a rename of the struct so that it can hold all data related to an IPCP in the system. The DIF name an IPCP belongs to is set on bootstrap and enrolment.
* lib: Implementation of flow related opsSander Vrijders2016-03-311-2/+34
| | | | | | This adds the messages that are sent to the IPCPs related to flows. Some messages are also sent to the IRMd (e.g. when a new flow arrives).
* lib, irmd: Update communication with IRMdSander Vrijders2016-03-301-81/+230
| | | | | All messages sent to the IRMd now also get a reply back with the result of the operation.
* lib: renamed rina_name_t to instance_name_tdimitri staessens2016-03-301-48/+48
| | | | | all functions taking a char * ap_name and uint id now take either a instance_name_t or instance_name_t *
* lib: Add ipcp_messages proto fileSander Vrijders2016-03-281-1/+1
| | | | | This removes the custom ser/des methods for communicating with the IPCP daemon and also uses GPB instead.
* lib, irmd: Use GPB for dev.c and IRMdSander Vrijders2016-03-281-44/+28
| | | | | IRMd and dev.c now also use GPB instead of our own ser/des. irm_msg struct has been dropped as well as the methods associated with it.
* lib: Adds IRMd messages for the dev.h API callsSander Vrijders2016-03-241-3/+3
| | | | | | This adds several messages for the dev.h API calls to communicate with the IRM daemon. The deserializing of these messages is still missing and the irmd hasn't been updated with them either.
* lib, irmd: Fix memleaksSander Vrijders2016-03-171-1/+12
| | | | | This removes some memleaks present in the sockets layer. It also fixes the bad initialization of the difs_size param in the irm_msg.
* irmd, lib: Create and destroy IPC ProcessesSander Vrijders2016-03-151-11/+16
| | | | | | This adds the functionality to create and destroy IPCPs. Upon creation a new process is forked and execve'd. Upon destruction the IPCP is destroyed by killing it with SIGTERM.
* irmd: Remove wrong copySander Vrijders2016-03-111-2/+1
| | | | | A NULL pointer was being passed instead of the actual name of the IPCP.
* lib: Add helpers for RINA namesSander Vrijders2016-03-111-27/+137
| | | | This adds helper functions for RINA names, to aid with handling them.
* irmd, lib: Replace stubs in irmdSander Vrijders2016-03-091-27/+52
| | | | | | This replaces the stubs in the irmd and calls the actual IPCP operations from the library. It also calls the DIF Allocator API in one of the operations.
* include: Fixed missing 'struct', renamed dif_infoDimitri Staessens2016-03-031-2/+2
| | | | | common.h: dif_info renamed to dif_config missing struct fixed
* lib, irmd: Fix memleaksSander Vrijders2016-03-031-9/+2
| | | | Fixes a couple of memleaks found while executing with valgrind.
* lib, irmd, tools: Provide more IRM messagesSander Vrijders2016-03-011-7/+55
| | | | | | | This provides the other messages that are used to communicate between the library and the IRM Daemon. The IRM tool just calls the library right now to see if it works. A full fledged program will be provided in a next commit.
* lib, irmd: Address Dimitri's commentsSander Vrijders2016-02-261-4/+6
| | | | This addresses several comments Dimitri had on the sockets layer code.
* lib, irmd, tools: Support to create IPCPsSander Vrijders2016-02-251-5/+43
| | | | | | | Provides the initial support to create IPCPs via a command-line tool. It extends the socket layer with a message that is sent over a socket to the irmd when the irm_create_ipcp library function is called from a program.
* lib: Initial messages for the IRMSander Vrijders2016-02-231-2/+55
| | | | | This provides the initial messages to be passed between the irmd and libouroboros-irm.
* src: Rename daemons and add tools folderSander Vrijders2016-02-221-0/+10
This renames the daemons to end with a 'd', as is common for UNIX daemons. It also adds a tools folder, that will hold the tools of the Ouroboros prototype. Examples are a simple echo application, an application to instruct the IRM ...