diff options
author | dimitri staessens <[email protected]> | 2017-02-07 20:45:14 +0100 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2017-02-07 21:00:45 +0100 |
commit | bfb86b66c8e7d9d8dc45d9075a4db6d10931dccf (patch) | |
tree | 022fbb7b2a54ba72affa12938b3bf79abc648b41 /src/ipcpd/ipcp.h | |
parent | 1bf2dd6aef3af6c81794c0551278373e44310b5c (diff) | |
download | ouroboros-bfb86b66c8e7d9d8dc45d9075a4db6d10931dccf.tar.gz ouroboros-bfb86b66c8e7d9d8dc45d9075a4db6d10931dccf.zip |
ipcpd: Refactor ipcpi struct
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.
Diffstat (limited to 'src/ipcpd/ipcp.h')
-rw-r--r-- | src/ipcpd/ipcp.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h index 8b590cc2..9a4d272a 100644 --- a/src/ipcpd/ipcp.h +++ b/src/ipcpd/ipcp.h @@ -23,9 +23,9 @@ #define IPCPD_IPCP_H #include <ouroboros/config.h> +#include <ouroboros/irm_config.h> -#include "ipcp-ops.h" -#include "ipcp-data.h" +#include "shim-data.h" #include <pthread.h> #include <time.h> @@ -37,16 +37,42 @@ enum ipcp_state { IPCP_SHUTDOWN }; +struct ipcp_ops { + int (* ipcp_bootstrap)(struct dif_config * conf); + + int (* ipcp_enroll)(char * dif_name); + + int (* ipcp_name_reg)(char * name); + + int (* ipcp_name_unreg)(char * name); + + int (* ipcp_name_query)(char * name); + + int (* ipcp_flow_alloc)(int fd, + char * dst_ap_name, + char * src_ae_name, + qoscube_t qos); + + int (* ipcp_flow_alloc_resp)(int fd, + int response); + + int (* ipcp_flow_dealloc)(int fd); +}; + struct ipcp { int irmd_api; char * name; + enum ipcp_type type; + char * dif_name; + uint64_t address; - struct ipcp_data * data; struct ipcp_ops * ops; int irmd_fd; + struct shim_data * shim_data; + enum ipcp_state state; pthread_rwlock_t state_lock; pthread_mutex_t state_mtx; @@ -57,7 +83,7 @@ struct ipcp { pthread_t * threadpool; } ipcpi; -int ipcp_init(enum ipcp_type type, +int ipcp_init(enum ipcp_type type, struct ipcp_ops * ops); int ipcp_boot(void); @@ -73,7 +99,7 @@ enum ipcp_state ipcp_get_state(void); int ipcp_wait_state(enum ipcp_state state, const struct timespec * timeout); -int ipcp_parse_arg(int argc, +int ipcp_parse_arg(int argc, char * argv[]); #endif |