diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-05-12 13:05:47 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-05-15 12:06:09 +0200 |
commit | 9903b8a2f9a7dc8ebac6928dcf2d2b5593ea0615 (patch) | |
tree | ea16469c2d8fbcb417ed89e0bbd550834d0602a6 /include | |
parent | b36acfd93b1dc16a153ca9b9077d113732accb4e (diff) | |
download | ouroboros-9903b8a2f9a7dc8ebac6928dcf2d2b5593ea0615.tar.gz ouroboros-9903b8a2f9a7dc8ebac6928dcf2d2b5593ea0615.zip |
ipcpd: Allow specifying fixed syntax
This commits adds the functions and messages to specify a fixed
protocol syntax during CACEP. It also revises the messages for
specifying the DT protocol syntax from the irm tool.
Diffstat (limited to 'include')
-rw-r--r-- | include/ouroboros/CMakeLists.txt | 1 | ||||
-rw-r--r-- | include/ouroboros/cacep.h | 12 | ||||
-rw-r--r-- | include/ouroboros/ipcp.h | 30 | ||||
-rw-r--r-- | include/ouroboros/proto.h | 44 | ||||
-rw-r--r-- | include/ouroboros/sockets.h | 1 |
5 files changed, 62 insertions, 26 deletions
diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt index f582b915..8f57d4d7 100644 --- a/include/ouroboros/CMakeLists.txt +++ b/include/ouroboros/CMakeLists.txt @@ -13,6 +13,7 @@ set(HEADER_FILES ipcp.h irm.h nsm.h + proto.h qos.h) install(FILES ${HEADER_FILES} DESTINATION usr/include/ouroboros) diff --git a/include/ouroboros/cacep.h b/include/ouroboros/cacep.h index 967151de..fb52fd0f 100644 --- a/include/ouroboros/cacep.h +++ b/include/ouroboros/cacep.h @@ -25,21 +25,19 @@ #define OUROBOROS_CACEP_H #include <ouroboros/cdefs.h> +#include <ouroboros/proto.h> #include <stdint.h> - -enum proto_concrete_syntax { - PROTO_GPB = 0, - PROTO_ASN_1, - PROTO_FIXED -}; +#include <sys/types.h> struct conn_info { char ae_name[64]; char protocol[64]; uint32_t pref_version; enum proto_concrete_syntax pref_syntax; - uint64_t addr; + struct proto_field fixed_conc_syntax[PROTO_MAX_FIELDS]; + size_t num_fields; + uint64_t addr; /* AE-I name */ }; __BEGIN_DECLS diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h index f418d640..05fdcd49 100644 --- a/include/ouroboros/ipcp.h +++ b/include/ouroboros/ipcp.h @@ -57,22 +57,22 @@ enum hash_algo { HASH_SHA3_512 }; +#define DIF_NAME_SIZE 256 + +struct dif_info { + char dif_name[DIF_NAME_SIZE]; + enum hash_algo dir_hash_algo; +}; + struct ipcp_config { - char * dif_name; + struct dif_info dif_info; + enum ipcp_type type; - enum hash_algo dir_hash_algo; - /* Normal DIF */ + /* DT syntax */ uint8_t addr_size; - uint8_t cep_id_size; - uint8_t pdu_length_size; - uint8_t seqno_size; - + uint8_t fd_size; bool has_ttl; - bool has_chk; - - uint32_t min_pdu_size; - uint32_t max_pdu_size; enum pol_addr_auth addr_auth_type; enum pol_gam dt_gam_type; @@ -86,12 +86,4 @@ struct ipcp_config { char * if_name; }; -#define DIF_NAME_SIZE 256 - -/* capability report of a DIF */ -struct dif_info { - enum hash_algo algo; - char dif_name[DIF_NAME_SIZE]; -}; - #endif /* OUROBOROS_IPCP_H */ diff --git a/include/ouroboros/proto.h b/include/ouroboros/proto.h new file mode 100644 index 00000000..30c549c0 --- /dev/null +++ b/include/ouroboros/proto.h @@ -0,0 +1,44 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Protocol syntax definitions + * + * Dimitri Staessens <dimitri.staessens@ugent.be> + * Sander Vrijders <sander.vrijders@ugent.be> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef OUROBOROS_PROTO_H +#define OUROBOROS_PROTO_H + +#include <sys/types.h> + +#define PROTO_FIELD_ABSENT -1 +#define PROTO_FIELD_VARIABLE 0 +#define PROTO_MAX_FIELDS 128 + +enum proto_concrete_syntax { + PROTO_GPB = 0, + PROTO_ASN_1, + PROTO_FIXED +}; + +struct proto_field { + size_t fid; /* an ID for the protocol field */ + ssize_t len; /* 0 variable, -1 not present */ +}; + +#endif /* OUROBOROS_PROTO_H */ diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h index bb8f6d87..660709bf 100644 --- a/include/ouroboros/sockets.h +++ b/include/ouroboros/sockets.h @@ -28,6 +28,7 @@ #include "ipcp_config.pb-c.h" typedef IpcpConfigMsg ipcp_config_msg_t; +typedef DifInfoMsg dif_info_msg_t; #include "irmd_messages.pb-c.h" typedef IrmMsg irm_msg_t; |