From 4d778a577c761e5839cd6b6ade35bcc5c4588b10 Mon Sep 17 00:00:00 2001 From: Amin Ben Romdhane <amin.benromdhane@iopsys.eu> Date: Mon, 21 Oct 2024 09:38:04 +0200 Subject: [PATCH] Fix vendor prefix value --- .gitlab-ci.yml | 2 +- src/common.h | 1 - src/interfacestack.c | 5 ++--- src/ip.c | 4 ++-- src/ppp.c | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b81ec81..9180c1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ variables: SOURCE_FOLDER: "src" - CFLAGS: "-DBBF_VENDOR_PREFIX=X_IOPSYS_EU" + CFLAGS: "-DBBF_VENDOR_PREFIX=\\\"X_IOPSYS_EU_\\\"" include: - project: 'iopsys/gitlab-ci-pipeline' diff --git a/src/common.h b/src/common.h index 49bb75c..7661902 100644 --- a/src/common.h +++ b/src/common.h @@ -13,7 +13,6 @@ #define __DMLAYER_H__ #include "libbbfdm-api/dmcommon.h" -#define STR(s) #s void gre___get_tunnel_system_name(struct uci_section *iface_section, char *device_str, size_t device_str_size); diff --git a/src/interfacestack.c b/src/interfacestack.c index 4a625d1..d0d238c 100644 --- a/src/interfacestack.c +++ b/src/interfacestack.c @@ -8,7 +8,6 @@ * Author: Amin Ben Romdhane <amin.benromdhane@iopsys.eu> */ -#include "common.h" #include "interfacestack.h" struct interfacestack_data @@ -101,7 +100,7 @@ static char *get_lower_alias_value(const char *path) } else if (DM_STRNCMP(path, "Device.PPP.Interface.", strlen("Device.PPP.Interface.")) == 0) { get_dmmap_section_of_config_section_eq("dmmap_ppp", "interface", "ppp_int_instance", instance + 1, &s); dmuci_get_value_by_section_string(s, "ppp_int_alias", &alias_value); - } else if (DM_STRNCMP(path, "Device.Ethernet."STR(BBF_VENDOR_PREFIX)"MACVLAN.", strlen("Device.Ethernet."STR(BBF_VENDOR_PREFIX)"MACVLAN.")) == 0) { + } else if (DM_STRNCMP(path, "Device.Ethernet."BBF_VENDOR_PREFIX"MACVLAN.", strlen("Device.Ethernet."BBF_VENDOR_PREFIX"MACVLAN.")) == 0) { get_dmmap_section_of_config_section_eq("dmmap_network", "device", "mac_vlan_instance", instance + 1, &s); dmuci_get_value_by_section_string(s, "mac_vlan_alias", &alias_value); } @@ -185,7 +184,7 @@ static int browseInterfaceStackInst(struct dmctx *dmctx, DMNODE *parent_node, vo uci_path_foreach_sections(bbfdm, "dmmap_network", "device", s) { if (create_interface_stack_instance(dmctx, parent_node, &curr_interfacestack_data, s, - "Device.Ethernet."STR(BBF_VENDOR_PREFIX)"MACVLAN.", "mac_vlan_instance", "mac_vlan_alias", &idx)) + "Device.Ethernet."BBF_VENDOR_PREFIX"MACVLAN.", "mac_vlan_instance", "mac_vlan_alias", &idx)) goto end; } diff --git a/src/ip.c b/src/ip.c index 8a3cf32..40953fb 100644 --- a/src/ip.c +++ b/src/ip.c @@ -1307,7 +1307,7 @@ static int get_IPInterface_LowerLayers(char *refparam, struct dmctx *ctx, void * } bbfdm_get_references(ctx, MATCH_FIRST, "Device.PPP.Interface.", "Name", device, buf, sizeof(buf)); - bbfdm_get_references(ctx, MATCH_FIRST, "Device.Ethernet."STR(BBF_VENDOR_PREFIX)"MACVLAN.", "Name", device, buf, sizeof(buf)); + bbfdm_get_references(ctx, MATCH_FIRST, "Device.Ethernet."BBF_VENDOR_PREFIX"MACVLAN.", "Name", device, buf, sizeof(buf)); bbfdm_get_references(ctx, MATCH_FIRST, "Device.Ethernet.VLANTermination.", "Name", device, buf, sizeof(buf)); bbfdm_get_references(ctx, MATCH_FIRST, "Device.Ethernet.Link.", "Name", device, buf, sizeof(buf)); @@ -1329,7 +1329,7 @@ static int set_IPInterface_LowerLayers(char *refparam, struct dmctx *ctx, void * { char *allowed_objects[] = { "Device.PPP.Interface.", - "Device.Ethernet."STR(BBF_VENDOR_PREFIX)"MACVLAN", + "Device.Ethernet."BBF_VENDOR_PREFIX"MACVLAN", "Device.Ethernet.VLANTermination.", "Device.Ethernet.Link.", "Device.GRE.Tunnel.*.Interface.", diff --git a/src/ppp.c b/src/ppp.c index 5af533f..03456aa 100644 --- a/src/ppp.c +++ b/src/ppp.c @@ -957,7 +957,7 @@ static int get_ppp_lower_layer(char *refparam, struct dmctx *ctx, void *data, ch if (DM_STRLEN(device) == 0) return 0; - bbfdm_get_references(ctx, MATCH_FIRST, "Device.Ethernet."STR(BBF_VENDOR_PREFIX)"MACVLAN.", "Name", device, buf, sizeof(buf)); + bbfdm_get_references(ctx, MATCH_FIRST, "Device.Ethernet."BBF_VENDOR_PREFIX"MACVLAN.", "Name", device, buf, sizeof(buf)); bbfdm_get_references(ctx, MATCH_FIRST, "Device.Ethernet.VLANTermination.", "Name", device, buf, sizeof(buf)); bbfdm_get_references(ctx, MATCH_FIRST, "Device.Ethernet.Link.", "Name", device, buf, sizeof(buf)); @@ -974,7 +974,7 @@ static int set_ppp_lower_layer(char *refparam, struct dmctx *ctx, void *data, ch { struct dm_data *ppp = (struct dm_data *)data; char *allowed_objects[] = { - "Device.Ethernet."STR(BBF_VENDOR_PREFIX)"MACVLAN", + "Device.Ethernet."BBF_VENDOR_PREFIX"MACVLAN", "Device.Ethernet.VLANTermination.", "Device.Ethernet.Link.", NULL}; -- GitLab