27 #include <json-c/json.h>
29 #include <rte_hash_crc.h>
42 #define MAX_CORES (32)
58 for (i = 0; i < key_size; i++) {
60 if (
'0' <= key_hex[i] && key_hex[i] <=
'9')
61 digit = key_hex[i] -
'0';
62 else if (
'a' <= tolower(key_hex[i]) && tolower(key_hex[i]) <=
'f')
63 digit = tolower(key_hex[i]) -
'a' + 10;
65 DOCA_LOG_ERR(
"Wrong format for key (%s) - not alpha-numeric", key_hex);
69 key[i / 2] = (key[i / 2] << 4) + digit;
84 struct json_object *json_key;
90 if (!json_object_object_get_ex(cur_rule,
"key", &json_key)) {
94 if (json_object_get_type(json_key) != json_type_string) {
99 key_str = json_object_get_string(json_key);
104 key_len = strnlen(key_str, max_key_size + 1);
105 if (key_len == max_key_size + 1) {
106 DOCA_LOG_ERR(
"Key string is too long - MAX=%ld", max_key_size);
109 if (key_len % 2 != 0) {
110 DOCA_LOG_ERR(
"Key string should be in hexadecimal format, length must be even");
129 struct json_object *json_key_type;
132 if (!json_object_object_get_ex(cur_rule,
"key-type", &json_key_type)) {
133 DOCA_LOG_DBG(
"Missing key type, default is DOCA_ENCRYPTION_KEY_AESGCM_256");
137 if (json_object_get_type(json_key_type) != json_type_int) {
142 key_len = json_object_get_int(json_key_type);
145 else if (key_len == 256)
163 struct json_object *json_iv;
167 const int max_iv_size = 8 * 2;
168 uint8_t iv_bytes[8] = {0};
169 uint8_t *read_head = iv_bytes;
171 if (!json_object_object_get_ex(cur_rule,
"iv", &json_iv)) {
176 if (json_object_get_type(json_iv) != json_type_string) {
181 iv_str = json_object_get_string(json_iv);
182 iv_len = strnlen(iv_str, max_iv_size + 1);
183 if (iv_len == max_iv_size + 1) {
184 DOCA_LOG_ERR(
"IV string is too long - MAX=%d", max_iv_size);
187 if (iv_len % 2 != 0) {
188 DOCA_LOG_ERR(
"IV string should be in hexadecimal format, length must be even");
208 struct json_object *json_salt;
210 if (!json_object_object_get_ex(cur_rule,
"salt", &json_salt)) {
215 if (json_object_get_type(json_salt) != json_type_int) {
219 *salt = (uint32_t)json_object_get_int64(json_salt);
232 struct json_object *json_lifetime;
234 if (!json_object_object_get_ex(cur_rule,
"lifetime-threshold", &json_lifetime)) {
235 DOCA_LOG_DBG(
"Missing lifetime-threshold, default is 0 (ignored)");
236 *lifetime_threshold = 0;
239 if (json_object_get_type(json_lifetime) != json_type_int) {
240 DOCA_LOG_ERR(
"Expecting a int value for \"lifetime-threshold\"");
243 *lifetime_threshold = (uint32_t)json_object_get_int64(json_lifetime);
256 struct json_object *json_esn_en;
258 if (!json_object_object_get_ex(cur_rule,
"esn_en", &json_esn_en)) {
262 if (json_object_get_type(json_esn_en) != json_type_boolean) {
266 *esn_en = json_object_get_boolean(json_esn_en);
280 struct json_object *json_protocol;
281 const char *protocol_str;
283 if (!json_object_object_get_ex(cur_rule,
"protocol", &json_protocol)) {
287 if (json_object_get_type(json_protocol) != json_type_string) {
288 DOCA_LOG_ERR(
"Expecting a string value for \"protocol\"");
292 protocol_str = json_object_get_string(json_protocol);
308 char *ip_version_string,
311 struct json_object *json_ip;
314 if (!json_object_object_get_ex(cur_rule, ip_version_string, &json_ip)) {
315 DOCA_LOG_DBG(
"Missing ip-version, using default: IPv4");
319 if (json_object_get_type(json_ip) != json_type_int) {
320 DOCA_LOG_ERR(
"Expecting a int value for \"ip-version\"");
324 ip = json_object_get_int(json_ip);
330 DOCA_LOG_ERR(
"Expecting 4 or 6 value for \"ip-version\"");
347 struct json_object *json_ip;
349 if (!json_object_object_get_ex(cur_rule, ip_type, &json_ip)) {
353 if (json_object_get_type(json_ip) != json_type_string) {
354 DOCA_LOG_ERR(
"Expecting a string value for \"%s\"", ip_type);
369 if (inet_pton(AF_INET6, str_ip, &
ip) != 1) {
373 for (i = 0; i < 4; i++)
374 ipv6_addr[i] =
ip.__in6_u.__u6_addr32[i];
389 struct json_object *json_ip;
391 if (!json_object_object_get_ex(cur_rule, ip_type, &json_ip)) {
395 if (json_object_get_type(json_ip) != json_type_string) {
396 DOCA_LOG_ERR(
"Expecting a string value for \"%s\"", ip_type);
416 struct json_object *json_port;
418 if (!json_object_object_get_ex(cur_rule, port_type, &json_port)) {
422 if (json_object_get_type(json_port) != json_type_int) {
423 DOCA_LOG_ERR(
"Expecting a int value for \"%s\"", port_type);
427 *port = json_object_get_int(json_port);
440 struct json_object *json_spi;
442 if (!json_object_object_get_ex(cur_rule,
"spi", &json_spi)) {
446 if (json_object_get_type(json_spi) != json_type_int) {
451 *esp_spi = (uint32_t)json_object_get_int64(json_spi);
487 struct rte_hash **ip6_table)
500 ret = rte_hash_lookup(*ip6_table, (
void *)rule->
ip6.
src_ip);
502 ret = rte_hash_add_key(*ip6_table, rule->
ip6.
src_ip);
509 ret = rte_hash_lookup(*ip6_table, (
void *)rule->
ip6.
dst_ip);
511 ret = rte_hash_add_key(*ip6_table, rule->
ip6.
dst_ip);
555 struct json_object *cur_rule;
557 DOCA_LOG_DBG(
"Number of decrypt rules in input file: %d",
app_cfg->app_rules.nb_decrypt_rules);
559 for (i = 0; i <
app_cfg->app_rules.nb_decrypt_rules; i++) {
560 cur_rule = json_object_array_get_idx(json_rules, i);
580 &
app_cfg->app_rules.decrypt_rules[i].inner_l3_type);
589 app_cfg->app_rules.decrypt_rules[i].sa_attrs.key_type,
590 app_cfg->app_rules.decrypt_rules[i].sa_attrs.enc_key_data);
603 &
app_cfg->app_rules.decrypt_rules[i].sa_attrs.lifetime_threshold);
625 struct json_object *cur_rule;
627 DOCA_LOG_DBG(
"Number of encrypt rules in input file: %d",
app_cfg->app_rules.nb_encrypt_rules);
629 for (i = 0; i <
app_cfg->app_rules.nb_encrypt_rules; i++) {
630 cur_rule = json_object_array_get_idx(json_rules, i);
641 &
app_cfg->app_rules.encrypt_rules[i].encap_l3_type);
677 app_cfg->app_rules.encrypt_rules[i].sa_attrs.key_type,
678 app_cfg->app_rules.encrypt_rules[i].sa_attrs.enc_key_data);
691 &
app_cfg->app_rules.encrypt_rules[i].sa_attrs.lifetime_threshold);
711 const char *offload_str;
712 struct json_object *esp_header_offload;
714 if (!json_object_object_get_ex(json_config,
"esp-header-offload", &esp_header_offload)) {
715 DOCA_LOG_DBG(
"Missing \"esp-header-offload\" parameter, default is offload both");
718 if (json_object_get_type(esp_header_offload) != json_type_string) {
719 DOCA_LOG_ERR(
"Expecting a string value for \"esp-header-offload\"");
723 offload_str = json_object_get_string(esp_header_offload);
724 if (strcmp(offload_str,
"both") == 0)
726 else if (strcmp(offload_str,
"encap") == 0)
728 else if (strcmp(offload_str,
"decap") == 0)
730 else if (strcmp(offload_str,
"none") == 0)
733 DOCA_LOG_ERR(
"ESP offload type %s is not supported", offload_str);
749 const char *perf_str;
750 struct json_object *perf_measure;
752 if (!json_object_object_get_ex(json_config,
"perf-measurements", &perf_measure)) {
753 DOCA_LOG_DBG(
"Missing \"perf-measurements\" parameter, default is none");
756 if (json_object_get_type(perf_measure) != json_type_string) {
757 DOCA_LOG_ERR(
"Expecting a string value for \"perf-measurements\"");
761 perf_str = json_object_get_string(perf_measure);
762 if (strcmp(perf_str,
"none") == 0)
764 else if (strcmp(perf_str,
"insertion-rate") == 0)
766 else if (strcmp(perf_str,
"bandwidth") == 0)
768 else if (strcmp(perf_str,
"both") == 0)
771 DOCA_LOG_ERR(
"Perf type %s is not supported", perf_str);
787 struct json_object *sw_antireplay_enable;
789 if (!json_object_object_get_ex(json_config,
"sw-antireplay-enable", &sw_antireplay_enable)) {
790 DOCA_LOG_DBG(
"Missing \"sw-antireplay-enable\" parameter, using false as default");
793 if (json_object_get_type(sw_antireplay_enable) != json_type_boolean) {
794 DOCA_LOG_ERR(
"Expecting a bool value for \"sw-antireplay-enable\"");
797 app_cfg->sw_antireplay = json_object_get_boolean(sw_antireplay_enable);
810 struct json_object *sw_sn_inc_enable;
812 if (!json_object_object_get_ex(json_config,
"sw-sn-inc-enable", &sw_sn_inc_enable)) {
813 DOCA_LOG_DBG(
"Missing \"sw-sn-inc-enable\" parameter, using false as default");
816 if (json_object_get_type(sw_sn_inc_enable) != json_type_boolean) {
817 DOCA_LOG_ERR(
"Expecting a bool value for \"sw-sn-inc-enable\"");
820 app_cfg->sw_sn_inc_enable = json_object_get_boolean(sw_sn_inc_enable);
833 struct json_object *sn_init_config;
836 if (!json_object_object_get_ex(json_config,
"sn-initial", &sn_init_config)) {
837 DOCA_LOG_DBG(
"Missing \"sn_initial\" parameter, using zero as default");
840 if (json_object_get_type(sn_init_config) != json_type_int) {
841 DOCA_LOG_ERR(
"Expecting a int value for \"sn-initial\"");
844 sn_init = json_object_get_int64(sn_init_config);
848 if (sn_init < 0 || sn_init > UINT32_MAX) {
849 DOCA_LOG_ERR(
"\"sn-initial\" should get non-negative 32 bits value");
853 DOCA_LOG_ERR(
"SN initial value is too close to the maximum value");
857 DOCA_LOG_ERR(
"SN initial value is too close to the maximum value");
861 app_cfg->sn_initial = (uint64_t)sn_init;
875 struct json_object *switch_config;
878 if (!json_object_object_get_ex(json_config,
"switch", &switch_config)) {
879 DOCA_LOG_DBG(
"Missing \"switch\" parameter, using vnf mode");
882 if (json_object_get_type(switch_config) != json_type_boolean) {
886 is_switch = json_object_get_boolean(switch_config);
902 struct json_object *debug_config;
905 if (!json_object_object_get_ex(json_config,
"debug", &debug_config)) {
908 if (json_object_get_type(debug_config) != json_type_boolean) {
912 debug = json_object_get_boolean(debug_config);
929 struct json_object *vni_config;
936 DOCA_LOG_ERR(
"Expecting a bool value for \"vxlan-encap\"");
944 if (!json_object_object_get_ex(json_config,
"vni", &vni_config)) {
946 DOCA_LOG_DBG(
"Missing \"vni\" value, using 1 as default");
949 if (json_object_get_type(vni_config) != json_type_int) {
953 app_cfg->vni = json_object_get_int(vni_config);
967 struct json_object *marker_encap_config;
970 if (!json_object_object_get_ex(json_config,
"marker-encap", &marker_encap_config)) {
973 if (json_object_get_type(marker_encap_config) != json_type_boolean) {
974 DOCA_LOG_ERR(
"Expecting a bool value for \"marker-encap\"");
977 marker_encap = json_object_get_boolean(marker_encap_config);
982 DOCA_LOG_ERR(
"Non-ESP marker not supported for VXLAN encapsulation");
999 struct json_object *fwd_obj;
1001 if (!json_object_object_get_ex(json_config,
"fwd-bad-syndrome", &fwd_obj)) {
1002 DOCA_LOG_DBG(
"Missing \"fwd-bad-syndrome\" parameter, default is drop");
1005 if (json_object_get_type(fwd_obj) != json_type_string) {
1006 DOCA_LOG_ERR(
"Expecting a string value for \"fwd-bad-syndrome\"");
1010 fwd_str = json_object_get_string(fwd_obj);
1011 if (strcmp(fwd_str,
"drop") == 0)
1013 else if (strcmp(fwd_str,
"rss") == 0)
1016 DOCA_LOG_ERR(
"Forward syndrome type %s is not supported", fwd_str);
1033 struct json_object *icv_length_config;
1035 if (!json_object_object_get_ex(json_config,
"icv-length", &icv_length_config)) {
1036 DOCA_LOG_DBG(
"Missing \"icv_length\" parameter, default is 16");
1040 if (json_object_get_type(icv_length_config) != json_type_int) {
1041 DOCA_LOG_ERR(
"Expecting a int value for \"icv-length\"");
1045 icv_length_int = json_object_get_int(icv_length_config);
1046 switch (icv_length_int) {
1057 DOCA_LOG_ERR(
"ICV length can only be one of the following: 8, 12, 16");
1133 ssize_t buf_len = 0;
1136 if (fseek(fp, 0L, SEEK_END) == 0) {
1137 buf_len = ftell(fp);
1144 *json_data = (
char *)calloc(1, buf_len + 1);
1145 if (*json_data ==
NULL) {
1151 if (fseek(fp, 0L, SEEK_SET) != 0) {
1158 *file_length = buf_len;
1172 if (
app_cfg->objects.secured_dev.has_device ==
false) {
1178 if (
app_cfg->objects.unsecured_dev.has_device ==
false) {
1182 if (
app_cfg->objects.unsecured_dev.open_by_pci ==
true &&
1183 app_cfg->objects.unsecured_dev.open_by_name ==
true) {
1184 DOCA_LOG_ERR(
"Please specify only one parameter for the unsecured device: -u / -un");
1189 if (
app_cfg->objects.secured_dev.open_by_pci ==
true &&
app_cfg->objects.secured_dev.open_by_name ==
true) {
1190 DOCA_LOG_ERR(
"Please specify only one parameter for the secured device: -s / -sn");
1195 DOCA_LOG_WARN(
"In switch mode unsecure port parameter will be ignored");
1200 DOCA_LOG_ERR(
"SW SN Increment cannot be enabled when offloading encap");
1206 DOCA_LOG_ERR(
"SW Anti-Replay cannot be enabled when offloading decap");
1221 struct rte_hash_parameters table_params = {
1222 .name =
"IPv6 table",
1224 .key_len =
sizeof(uint32_t) * 4,
1225 .hash_func = rte_hash_crc,
1226 .hash_func_init_val = 0,
1229 *ip6_table = rte_hash_create(&table_params);
1230 if (*ip6_table ==
NULL)
1240 char *json_data =
NULL;
1241 struct json_object *parsed_json;
1242 struct json_object *json_encrypt_rules;
1243 struct json_object *json_decrypt_rules;
1244 struct json_object *json_config;
1246 int nb_encrypt_alloc, nb_decrypt_alloc;
1250 DOCA_LOG_ERR(
"Failed to create table for ipv6 addresses");
1257 json_fp = fopen(
app_cfg->json_path,
"r");
1258 if (json_fp ==
NULL) {
1266 DOCA_LOG_ERR(
"Failed to allocate data buffer for the json file");
1270 if (fread(json_data, 1, file_length, json_fp) < file_length)
1274 parsed_json = json_tokener_parse(json_data);
1276 if (json_object_object_get_ex(parsed_json,
"config", &json_config)) {
1292 if (!
app_cfg->socket_ctx.socket_conf) {
1293 if (!json_object_object_get_ex(parsed_json,
"encrypt-rules", &json_encrypt_rules)) {
1299 if (!json_object_object_get_ex(parsed_json,
"decrypt-rules", &json_decrypt_rules)) {
1305 app_cfg->app_rules.nb_encrypt_rules = json_object_array_length(json_encrypt_rules);
1306 app_cfg->app_rules.nb_decrypt_rules = json_object_array_length(json_decrypt_rules);
1309 DOCA_LOG_ERR(
"Number of rules exceeds the maximum number of rules allowed");
1314 if (
app_cfg->app_rules.nb_encrypt_rules == 0 &&
app_cfg->app_rules.nb_decrypt_rules == 0) {
1315 DOCA_LOG_ERR(
"No encrypt and decrypt rules were found");
1320 app_cfg->app_rules.nb_rules =
app_cfg->app_rules.nb_encrypt_rules +
app_cfg->app_rules.nb_decrypt_rules;
1322 nb_encrypt_alloc =
app_cfg->app_rules.nb_encrypt_rules;
1323 nb_decrypt_alloc =
app_cfg->app_rules.nb_decrypt_rules;
1325 app_cfg->app_rules.nb_encrypt_rules = nb_encrypt_alloc;
1326 app_cfg->app_rules.nb_decrypt_rules = nb_decrypt_alloc;
1331 DOCA_LOG_ERR(
"calloc() function failed to allocate encryption rules array");
1338 DOCA_LOG_ERR(
"calloc() function failed to allocate decryption rules array");
1340 goto encrypt_release;
1344 if (!
app_cfg->socket_ctx.socket_conf) {
1348 goto dec_enc_release;
1354 goto dec_enc_release;
1357 json_object_put(parsed_json);
1361 free(
app_cfg->app_rules.decrypt_rules);
1363 free(
app_cfg->app_rules.encrypt_rules);
1365 json_object_put(parsed_json);
1379 char *pci_addr = (
char *)param;
1382 DOCA_LOG_ERR(
"Entered device PCI address exceeding the maximum size of %d",
1404 char *iface_name = (
char *)param;
1483 app_cfg->nb_cores = *(uint8_t *)param;
1486 "The application's memory consumption depends on the amount of used cores, a value above %d might lead to unstable results",
1503 app_cfg->debug_mode = *(
bool *)param;
1541 const char *
mode = (
char *)param;
1543 if (strcmp(
mode,
"tunnel") == 0)
1545 else if (strcmp(
mode,
"transport") == 0)
1547 else if (strcmp(
mode,
"udp_transport") == 0)
1567 char *file_path = (
char *)param;
1574 app_cfg->socket_ctx.socket_conf =
true;
1581 struct doca_argp_param *secured_param, *unsecured_param, *config_param, *ipsec_mode, *socket_path,
1582 *secured_name_param, *unsecured_name_param, *nb_cores, *debug_mode;
static doca_error_t create_esn_en(struct json_object *cur_rule, bool *esn_en)
static doca_error_t create_port(struct json_object *cur_rule, char *port_type, int *port)
static doca_error_t parse_perf_measurement(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t secured_name_callback(void *param, void *config)
static doca_error_t create_key_type(struct json_object *cur_rule, enum doca_flow_crypto_key_type *key_type)
static doca_error_t parse_esp_offload(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t create_l3_type(struct json_object *cur_rule, char *ip_version_string, enum doca_flow_l3_type *l3_type)
static doca_error_t create_salt(struct json_object *cur_rule, uint32_t *salt)
static doca_error_t create_lifetime_threshold(struct json_object *cur_rule, uint32_t *lifetime_threshold)
static doca_error_t parse_debug_config(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t parse_encrypt_encap_ip(struct json_object *cur_rule, struct encrypt_rule *rule)
static doca_error_t secured_callback(void *param, void *config)
static doca_error_t parse_sn_inc(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t create_iv(struct json_object *cur_rule, uint64_t *iv)
static doca_error_t parse_json_decrypt_rules(struct json_object *json_rules, struct ipsec_security_gw_config *app_cfg)
doca_error_t register_ipsec_security_gw_params(void)
static doca_error_t parse_iface_name_param(void *param, struct ipsec_security_gw_dev_info *dev_info)
static doca_error_t parse_antireplay(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t nb_cores_callback(void *param, void *config)
static doca_error_t parse_icv_length(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t create_ipv4(struct json_object *cur_rule, char *ip_type, doca_be32_t *ip)
doca_error_t ipsec_security_gw_parse_config(struct ipsec_security_gw_config *app_cfg)
static doca_error_t create_key(struct json_object *cur_rule, enum doca_flow_crypto_key_type key_type, uint8_t *key)
static doca_error_t create_spi(struct json_object *cur_rule, doca_be32_t *esp_spi)
static doca_error_t create_protocol(struct json_object *cur_rule, enum doca_flow_l4_type_ext *protocol)
static doca_error_t parse_vxlan_encap_config(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t debug_mode_callback(void *param, void *config)
static doca_error_t allocate_json_buffer_dynamic(FILE *fp, size_t *file_length, char **json_data)
static doca_error_t create_ip6_table(struct rte_hash **ip6_table)
static doca_error_t parse_json_config(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t offload_mode_callback(void *param, void *config)
static doca_error_t parse_sn_initial(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t socket_callback(void *param, void *config)
static doca_error_t parse_bad_syndrome_fwd(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t unsecured_name_callback(void *param, void *config)
static doca_error_t parse_hex_to_bytes(const char *key_hex, size_t key_size, uint8_t *key)
static doca_error_t config_callback(void *param, void *config)
static doca_error_t parse_marker_encap_config(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t validate_config(struct ipsec_security_gw_config *app_cfg)
static doca_error_t parse_switch_config(struct json_object *json_config, struct ipsec_security_gw_config *app_cfg)
static doca_error_t create_ipv6(struct json_object *cur_rule, char *ip_type, doca_be32_t ip[])
doca_error_t parse_ipv6_str(const char *str_ip, doca_be32_t ipv6_addr[])
static doca_error_t parse_encrypt_ipv4(struct json_object *cur_rule, struct encrypt_rule *rule)
static doca_error_t parse_encrypt_ipv6(struct json_object *cur_rule, struct encrypt_rule *rule, struct rte_hash **ip6_table)
static doca_error_t parse_json_encrypt_rules(struct json_object *json_rules, struct ipsec_security_gw_config *app_cfg)
static doca_error_t parse_pci_param(void *param, struct ipsec_security_gw_dev_info *dev_info)
DOCA_LOG_REGISTER(IPSEC_SECURITY_GW::config)
static doca_error_t unsecured_callback(void *param, void *config)
struct rte_eth_dev_info dev_info
if(bitoffset % 64+bitlength > 64) result|
doca_error_t parse_protocol_string(const char *protocol_str, enum doca_flow_l4_type_ext *protocol)
doca_error_t parse_ipv4_str(const char *str_ip, doca_be32_t *ipv4_addr)
static struct app_gpu_cfg app_cfg
DOCA_EXPERIMENTAL void doca_argp_param_set_description(struct doca_argp_param *param, const char *description)
Set the description of the program param, used during program usage.
DOCA_EXPERIMENTAL void doca_argp_param_set_long_name(struct doca_argp_param *param, const char *name)
Set the long name of the program param.
DOCA_EXPERIMENTAL void doca_argp_param_set_callback(struct doca_argp_param *param, doca_argp_param_cb_t callback)
Set the callback function of the program param.
DOCA_EXPERIMENTAL void doca_argp_param_set_mandatory(struct doca_argp_param *param)
Mark the program param as mandatory.
DOCA_EXPERIMENTAL doca_error_t doca_argp_param_create(struct doca_argp_param **param)
Create new program param.
DOCA_EXPERIMENTAL void doca_argp_param_set_type(struct doca_argp_param *param, enum doca_argp_type type)
Set the type of the param arguments.
DOCA_EXPERIMENTAL doca_error_t doca_argp_register_version_callback(doca_argp_param_cb_t callback)
Register an alternative version callback.
DOCA_EXPERIMENTAL void doca_argp_param_set_short_name(struct doca_argp_param *param, const char *name)
Set the short name of the program param.
DOCA_EXPERIMENTAL doca_error_t doca_argp_register_param(struct doca_argp_param *input_param)
Register a program flag.
#define DOCA_DEVINFO_IFACE_NAME_SIZE
Buffer size to hold network interface name. Including a null terminator.
#define DOCA_DEVINFO_PCI_ADDR_SIZE
Buffer size to hold PCI BDF format: "XXXX:XX:XX.X". Including a null terminator.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_INVALID_VALUE
@ DOCA_ERROR_NOT_SUPPORTED
doca_flow_crypto_key_type
doca flow crypto key type
@ DOCA_FLOW_CRYPTO_ICV_LENGTH_16
@ DOCA_FLOW_CRYPTO_ICV_LENGTH_12
@ DOCA_FLOW_CRYPTO_ICV_LENGTH_8
@ DOCA_FLOW_CRYPTO_KEY_128
@ DOCA_FLOW_CRYPTO_KEY_256
doca_flow_l4_type_ext
doca flow layer 4 packet extend type
doca_flow_l3_type
doca flow layer 3 packet type
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_WARN(format,...)
Generates a WARNING application log message.
#define DOCA_LOG_DBG(format,...)
Generates a DEBUG application log message.
@ IPSEC_SECURITY_GW_FWD_SYNDROME_DROP
@ IPSEC_SECURITY_GW_FWD_SYNDROME_RSS
@ IPSEC_SECURITY_GW_UDP_TRANSPORT
@ IPSEC_SECURITY_GW_TUNNEL
@ IPSEC_SECURITY_GW_TRANSPORT
@ IPSEC_SECURITY_GW_SWITCH
@ IPSEC_SECURITY_GW_ESP_OFFLOAD_ENCAP
@ IPSEC_SECURITY_GW_ESP_OFFLOAD_DECAP
@ IPSEC_SECURITY_GW_ESP_OFFLOAD_BOTH
@ IPSEC_SECURITY_GW_ESP_OFFLOAD_NONE
#define DYN_RESERVED_RULES
@ IPSEC_SECURITY_GW_PERF_NONE
@ IPSEC_SECURITY_GW_PERF_BW
@ IPSEC_SECURITY_GW_PERF_BOTH
@ IPSEC_SECURITY_GW_PERF_INSERTION_RATE
#define MAX_SOCKET_PATH_NAME
uint64_t unpack_uint64(uint8_t **buffer)
doca_be32_t encap_dst_ip4
struct ipsec_security_gw_ip6 ip6
enum doca_flow_l3_type encap_l3_type
doca_be32_t encap_dst_ip6[4]
struct ipsec_security_gw_ip4 ip4
enum ipsec_security_gw_mode mode
char json_path[MAX_FILE_NAME]
size_t strlcpy(char *dst, const char *src, size_t size)
noreturn doca_error_t sdk_version_callback(void *param, void *doca_config)