summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/main.c
Commit message (Collapse)AuthorAgeFilesLines
* ipcpd: Fix cleanup of connmgrdimitri staessens2017-03-201-2/+2
| | | | Fixed trying to double lock and cleanup order in main.
* Change email addresses to ugent.beSander Vrijders2017-03-031-2/+2
| | | | | | | Our mailserver was migrated from intec.ugent.be to the central ugent.be emailserver. This PR updates the header files to reflect this change as well. Some header files were also homogenized if the parameters within the functions were badly aligned.
* ipcpd: normal: Refactor application entities and add neighbors structSander Vrijders2017-03-031-13/+41
| | | | | | | | | | | | | | | | | | | | This refactors the different Application Entities of the normal IPCP. They all listen to and use the connection manager to establish new application connections. This commit also adds a neighbors struct to the normal IPCP. It contains neighbor structs that contain application connection. Notifiers can be registered in case a neighbor changes (added, removed, QoS changed). The flow manager has an instance of this neighbors struct and listens to these events to update its flow set. The routing component also listens to these events so that it can update the FSDB if needed. The flow manager now also creates the PFF instances and the routing instances per QoS cube. The RIB manager also uses this an instance of the neighbors struct and listens to neighbor events as well.
* ipcpd: normal: Add connection managerSander Vrijders2017-03-021-67/+26
| | | | | | | This adds the connection manager which allows the different AEs of the normal IPCP to register with it. An AE can then use the connection manager to allocate a flow to a neighbor, or to wait for a new connection from a neighbor.
* lib: Split authentication from CACEPdimitri staessens2017-02-271-11/+0
| | | | | | | By removing authentication as part of CACEP, all policies disappear. CACEP becomes a policy-free connection establishment protocol between Application Entities. Authentication can later be added cleanly as a pure policy function when needed.
* lib: Remove application entity nameSander Vrijders2017-02-241-5/+4
| | | | | The AE name should not be passed over the layer boundaries. If an application has more than one AE it should exchange this in CACEP.
* Merge branch 'testing' into beSander Vrijders2017-02-231-4/+2
|\
| * irmd: Check IPCP type before bootstrapdimitri staessens2017-02-221-4/+2
| | | | | | | | | | This prevents assertion failures in the IPCP in some cases. IPCPs can now safely assert the type.
* | ipcpd: normal: Change address authority policySander Vrijders2017-02-211-11/+9
| | | | | | | | | | | | This changes the address authority to follow a similar approach to that of the other policies. No function pointers are passed to its user anymore.
* | lib: Revise CACEPdimitri staessens2017-02-201-1/+1
|/ | | | | | | | | Revises CACEP policies to stateless library calls. It provides two policies: an anonymous authentication policy that will generate random credentials for the peer, and a simple authentication policy that will return a name for the peer and an address. Changes the normal IPCP to use the updates API calls.
* ipcpd: Move RIB configuration to common headerdimitri staessens2017-02-171-5/+1
| | | | | Moves the definitions of paths in the RIB for the normal IPCP to a header ribconfig.h to avoid repetition.
* ipcpd: Silent shutdown of normaldimitri staessens2017-02-101-2/+3
| | | | | The acceptor will not log disconnects with IRMd. Unexpected disconnects will be reported and handled by management components.
* ipcpd: Remove logging if not initialized yetSander Vrijders2017-02-101-1/+0
| | | | | | This removes the logs that would print to stdout if the IPCP fails to initialize. If the user had asked that logs would be printed to the syslog this would be unwanted behaviour.
* ipcpd: Print size_t and uint64_t in portable waydimitri staessens2017-02-091-2/+3
| | | | | | On 32-bit systems size_t is different than on 64 bit systems. The correct way to print a size_t is with %z. uint64_t is printed portably with the PRIu64 macro.
* ipcpd, lib: Report IPCP creation failuredimitri staessens2017-02-091-1/+5
| | | | | | | | The IPCP will now respond with an ipcp_create_r message when it fails, informing the IRMd. Also adds some const qualifiers in the public headers and fixes some formatting in dev.c.
* ipcpd: Fix boot order of normaldimitri staessens2017-02-081-4/+10
| | | | | | irm_bind has to be called after ipcp_init() since it targets the AP-I and needs the pid to be registered with the IRMd. Also fixes missing unbinding of the AP-I.
* lib: Log to the logging systemdimitri staessens2017-02-081-75/+66
| | | | | | | | | | This removes the logfile and outputs log messages to the logging system. The creation of the logfiles (as well as the ap_init() call) were moved into ipcp_init() to simplify the IPCP creation and shutdown. Fixes #25 Fixes #27
* ipcpd: Refactor ipcpi structdimitri staessens2017-02-071-2/+2
| | | | | | | | | The ipcp-ops header was removed and merged into ipcp.h. The common components dif_name and ipcp_type have been moved to the main ipcp struct. After this move, ipcp_data only contained shim information, so it was renamed to shim_data. The ipcp_init() function checks the type and will only include the shim_data if the type is not an IPCP_NORMAL. All ipcps have been adapted to this change in API.
* ipcpd, lib: Revise normal IPCPdimitri staessens2017-02-061-111/+241
| | | | | | | | | | This PR updates the normal IPCP to use the new RIB. The old ribmgr is removed and replaced by a stub that needs to be implemented. All components (dir, fmgr, frct) were adapted to the new RIB API. A lot of functionality was moved outside of the ribmgr, such as the addr_auth, which is now a component of the IPCP. The address is also stored to the ipcpi struct. The irm tool has an option to set the gam policy of the rib manager.
* ipcpd: Don't strdup() the dif_name in main loopdimitri staessens2017-01-291-2/+7
|
* ipcpd: normal: Add graph adjacency managerSander Vrijders2017-01-091-4/+7
| | | | | This commit adds the graph adjacency manager to the normal IPCP, which sets up N-1 flows to other members.
* ipcpd: Let IPCPs bind a nameSander Vrijders2017-01-091-9/+7
| | | | | | | This allows IPCPs to bind a name, so that they can announce their name to neighbors which can then allocate a flow to them. Registering of the name happens by an administrator. It also moves the irmd_api to common ground, since it is used by all IPCPs.
* ipcpd: Revert normal IPCP state correctlydimitri staessens2017-01-041-0/+2
| | | | | The state of the IPCP should revert to INIT when pthread_create fails in the normal and bootstrapping procedures.
* ipcpd: Add boot and shutdown operationsdimitri staessens2017-01-041-59/+84
| | | | | | | These operations separe the starting and joining of the main ipcp threads into ipcp_boot() and ipcp_shutdown() operations. This allows the proper cleanup of user data and user threads after the IPCP is requested to shut down.
* ipcpd: Refactor of normal IPCPdimitri staessens2017-01-041-43/+138
| | | | | | | | | | | | | | Reorganizes the normal IPCP a bit to make sure internal components do not need to access the state of the IPCP. The IPCP has now a thread calling accept and delegating it to the correct component based on the AE name (this used to be in the fmgr). Internal components are initialized upon enrollment or bootstrap of the IPCP. If a step fails, the IPCP goes back to the INIT state, if all components boot correctly, it goes to the operational state. RIB synchronization is still done by sending a CDAP start/stop and syncing with a ribmgr state, but needs revision later on.
* ipcpd: Wait for operational state to start fmgrdimitri staessens2016-12-281-5/+7
| | | | | | The main thread will wait for the IPCP_OPERATIONAL state before starting the fmgr main thread by calling fmgr_init(), instead of the fmgr itself waiting for that state.
* ouroboros: Correct license statementsdimitri staessens2016-12-241-3/+2
| | | | | This corrects the license statements on all files. Installed headers are LGPLv2.1, the rest of the code is GPLv2.
* Merged in sandervrijders/ouroboros/be-operational-state (pull request #319)dimitri staessens2016-12-061-2/+2
|\ | | | | | | ipcpd: Change IPCP_RUNNING to IPCP_OPERATIONAL
| * ipcpd: Change IPCP_RUNNING to IPCP_OPERATIONALSander Vrijders2016-12-061-2/+2
| | | | | | | | Changes a state of the IPCP to a more correct terminology.
* | ipcpd: normal: Fix errors on IPCP shutdownSander Vrijders2016-12-061-3/+0
|/ | | | | This fixes several bad cleanups in the normal IPCP when it is shutting down.
* ipcpd: normal: Provide directory for registered namesSander Vrijders2016-12-021-48/+7
| | | | | This adds a directory to the normal IPCP that maps names on IPCP addresses.
* ipcpd: Split IPCP state PENDING_ENROLSander Vrijders2016-11-301-7/+25
| | | | | | | | This will split the IPCP state PENDING_ENROL into IPCP_CONFIG and IPCP_BOOTING. IPCP_CONFIG is concerned only with configuring the IPCP with the bare essence. When in IPCP_BOOTING, the IPCP will complete its configuration by starting its policies, and thus making the IPCP completely functioning.
* ipcpd: normal: Fix bugs in connection establishmentSander Vrijders2016-10-271-0/+10
| | | | This fixes some bugs in connection establishment over the normal IPCP.
* lib, irmd, ipcpd: Add name querying to IPCPsSander Vrijders2016-10-261-7/+23
| | | | | | | | | This adds the ability to query IPCPs if a name can be reached through them, e.g. if a name is available in a DIF. This means that in the shim-udp a DNS query is performed, in the shim-eth-llc an ARP-like query has been added, in the local a check is done to see if the name is registered, and in the normal currently no application is reachable through it.
* build: Comply with -Wextra compiler flagdimitri staessens2016-10-211-0/+2
| | | | | This reduces the risk for some bugs, for instance due to signed/unsigned mismatches and unused variables.
* ipcpd: normal: Improve upon the internal designSander Vrijders2016-10-121-4/+4
| | | | | | | | This commit will remove the RMT component from the normal IPCP, as some of its functionality would else be duplicated in the FMGR. Now all reading from flows, either N-1 or N+1 is done in the FMGR, then either passed to the FRCT or a lookup is performed in the PFF (not there yet) and the PDU is forwarded.
* lib, ipcp: Revise fast path and flow interfacesdimitri staessens2016-10-041-136/+36
| | | | | | | | | | | | IPCPs can now use ap_init() to initialize the memory. All flows are accessed using flow descriptors, this greatly simplifies IPCP development. Reverts the fast path to a single ap_rbuff per process. Splits lib/ipcp into irmd/ipcp and lib/ipcp-dev. Adds a lib/shim-dev holding tailored functions for shims. Moves the buffer_t to utils.h. Fixes the shim-eth-llc length field. Removes the flow from shared.h. Fixes #4 Fixes #5
* lib: Add northbound ringbuffersdimitri staessens2016-09-021-1/+1
| | | | Fast path is split in north and southbound paths.
* lib: Refactor shm_du_map to shm_rdrbuffdimitri staessens2016-08-291-7/+13
| | | | | | | | | | The shm_du_map is renamed to shm_rdrbuff to reflect the Random Deletion Ringbuffer used in the implementation. The close_on_exit call is removed and SDUs are cleaned up by the application in the ap_fini() call. This required a non-blocking peek() operation in the shm_ap_rbuff. Some initial implementation for future support of qos cubes has been added to the shm_rdrbuff.
* ipcpd: Report pid on shutdowndimitri staessens2016-08-261-2/+2
| | | | IPCPs will report their pid on shutdown for faster debugging.
* ipcpd, normal: Safe handling of CDAP requestsdimitri staessens2016-08-251-11/+11
| | | | Destruction of the object in the reply stage was unsafe.
* ipcpd, normal: Fix bad lockdimitri staessens2016-08-251-3/+4
|
* ipcpd: Revised lockingdimitri staessens2016-08-241-49/+34
| | | | | | The state lock was reverted to an rwlock to avoid interference of management functions with the fast path. IPCPs now close without calling unsafe functions in the signal handler.
* ipcpd: normal: Handle enrollment repliesSander Vrijders2016-08-191-2/+16
| | | | | | | | This adds a condition variable with a timeout to the CDAP request so that we can respond correctly to the answer from the remote. It also adds a timeout to the condition variable waiting on completion of enrollment. Furthermore, for every CDAP callback a new thread is now spawned, to avoid deadlocking in case a callback is stuck.
* ipcpd: Fix bootstrap with api_binddimitri staessens2016-08-121-9/+6
| | | | | Calling api_bind during bootstrap caused the IRMd to lock up. api_bind is now called after the normal completes bootstrapping.
* ipcpd: Add condition variable to IPCP stateSander Vrijders2016-08-111-31/+28
| | | | | | | This adds a condition variable to the IPCP state, so that upon state changes any listeners to state changes can be notified. It also replaces the read/write lock with a mutex in order to be able to do so.
* ipcpd: Fix deep copy of dif_configdimitri staessens2016-08-111-3/+5
| | | | | conf->dif_name was not copied from the dif_config gpb message. Fixes some logs.
* ipcpd: normal: Fix log messagedimitri staessens2016-08-111-1/+1
|
* lib, irmd: Bind AP instances to AP_subsetsdimitri staessens2016-08-101-0/+5
| | | | | | | This call will allow grouping AP instances of a certain AP together which are configured identically. Adds the bind operation to dev and updates the applications to make use of this call. Flow_alloc is now only called with the pid and doesn't send the apn anymore.
* ipcp, irmd, lib: Notify IRMd upon IPCP initializationSander Vrijders2016-08-101-0/+10
| | | | | | This will notify the IRMd when the IPCP is initialized and ready to receive messages. Previously a bootstrap could fail since the IPCP was not listening to the socket yet.