Skip to content

Conversation

@Krithiksha11
Copy link

Reason for change: Receive the MAP-E options from DhcpManager and configure the tunnel interface.
Test Procedure: Verify functionality by passing DHCPv6 Option 94 and the ip6tnl tunnel interface is correctly configured and brought up.
Testing Done : Results are captured in RDKBNETWOR-66
Risks: None.

Reason for change: Receive the MAP-E options from DhcpManager and configure the tunnel interface.
Test Procedure: Verify functionality by passing DHCPv6 Option 94 and the ip6tnl tunnel interface is correctly configured and brought up.
Testing Done : Results are captured in RDKBNETWOR-66
Risks: None.

Signed-off-by: Krithiksha Prabhakar <krithiksha.prabhakar@telekom-digital.com>
Reason for change: Enclose MAP-E logic within FEATURE_MAPE flag

Signed-off-by: Krithiksha Prabhakar <krithiksha.prabhakar@telekom-digital.com>
Reason for change: Write the PSID vlaues to /proc/nat_port so that the kernel reads these value and configures correct ports for MAPE.
Test Procedure: Verify functionality by passing DHCPv6 Option 94 and the ip6tnl tunnel interface is correctly configured and brought up.
Testing Done : Results are captured in RDKBNETWOR-66
Risks: None.

Signed-off-by: Krithiksha Prabhakar <krithiksha.prabhakar@telekom-digital.com>
char wan_interface[BUFLEN_64]={0};

CcspTraceInfo(("%s %d - stop MAP-E\n", __FUNCTION__, __LINE__));
if (syscfg_get(NULL, SYSCFG_WAN_INTERFACE, wan_interface, sizeof(wan_interface)) != ANSC_STATUS_SUCCESS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a syscfg, we can use the current interface name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

}
#endif

#ifdef FEATURE_MAPE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it similar to the previous if condition for the MAPE? can we have single condition?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, merged to single if condition

CcspTraceError(("%s %d Error resetting MAP-T configuration", __FUNCTION__, __LINE__));
}

/* Clear DHCPv4 client */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting DHCPv4 should be common for both MAPE and MAPT.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved outside if condition

CcspTraceInfo(("%s %d: Stopping DHCP v4\n", __FUNCTION__, __LINE__));
WanManager_StopDhcpv4Client(p_VirtIf, STOP_DHCP_WITH_RELEASE);
}
if (p_VirtIf->IP.Dhcp4cStatus == DHCPC_STARTED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stopping DHCPv4 should be common for both MAPE and MAPT

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved outside MAPT condition

inet_ntop(AF_INET6, &in6, tunnel_source, sizeof(tunnel_source));

//tunnel_source
ret = v_secure_system("ip -6 tunnel add %s mode ip4ip6 remote %s local %s encaplimit none dev %s", TUNNEL_NAME, br_ipv6_prefix, tunnel_source, "erouter0");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't hard code erouter0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

#endif //FEATURE_MAPT

#ifdef FEATURE_MAPE
else if ( pInterface->Selection.Status == WAN_IFACE_ACTIVE && p_VirtIf->Status == WAN_IFACE_STATUS_UP && p_VirtIf->MAP.dhcp6cMAPparameters.mapType == MAP_TYPE_MAPE && p_VirtIf->MAP.MapeStatus == WAN_IFACE_MAPE_STATE_UP)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add it with the MAPT if condition itself. Both are same transition

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined the conditions

}
#endif //FEATURE_MAPT

#ifdef FEATURE_MAPE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets keep both transitions together.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined the conditions

#define BUFF_SIZE_64 64
#define BUFF_SIZE_1024 1024
#define IPV4_ADDR_LEN_IN_BITS 32
#define BUF_LEN (10 * (sizeof(struct inotify_event) + 255 + 1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used in the code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed unused macros

}

#ifdef FEATURE_MAPE
ANSC_STATUS WanManager_MAPEConfiguration(ipc_map_data_t *dhcp6cMAPEMsgBody)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this function be moved to a new file for MAPE?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to new file as suggested

@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/wan-manager/134/rdkcentral/RdkWanManager

  • Commit: 109927b

Report detail: gist'

Reason for change: Address the review comments.
Test Procedure: Verify functionality by passing DHCPv6 Option 94 and the ip6tnl tunnel interface is correctly configured and brought up.
Testing Done : Results are captured in RDKBNETWOR-66
Risks: None.

Signed-off-by: Krithiksha Prabhakar <krithiksha.prabhakar@telekom-digital.com>
@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/wan-manager/134/rdkcentral/RdkWanManager

  • Commit: 5185d67

Report detail: gist'

@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/wan-manager/134/rdkcentral/RdkWanManager

  • Commit: 9694a52

Report detail: gist'

@mhughesacn
Copy link

mhughesacn commented Aug 29, 2025

Hi @Krithiksha11 : Please append a credit to NOTICE at top level, to match the new DT code:

Copyright 2025 Deutsche Telekom AG.
Licensed under the Apache License, Version 2.0

I will clear off the BD failure.
Thank you!

Reason for change: Appended a credit to NOTICE at top level, to match the new DT code.
Risks: None.

Signed-off-by: Krithiksha Prabhakar <krithiksha.prabhakar@telekom-digital.com>
@Krithiksha11
Copy link
Author

Hi @Krithiksha11 : Please append a credit to NOTICE at top level, to match the new DT code:

Copyright 2025 Deutsche Telekom AG.
Licensed under the Apache License, Version 2.0

I will clear off the BD failure. Thank you!

Hi @mhughesacn,

I have added the same. Please review it.

Thank you

@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/wan-manager/134/rdkcentral/RdkWanManager

  • Commit: 270ed20

Report detail: gist'

@mhughesacn
Copy link

Thank you @Krithiksha11

<name>Enable</name>
<type>boolean</type>
<syntax>bool</syntax>
<writable>true</writable>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to keep these DMLs read-only, as we're only using RBUS events or IPC methods to send lease details to the WAN Manager.

If these DMLs are writable, it opens up the possibility for someone to modify the configuration directly, which could conflict with the current design.

I understand that the BBF specification defines them as writable, but allowing write access here could introduce issues.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

@mhughesacn
Copy link

Hi @Krithiksha11 : I just noticed this: If you make any more changes to this PR, please will you fix the headers on the new files you created. They say "this component's Licenses.txt file", but newer headers say "this component's LICENSE file". We changed the license name a long time ago, but headers have been slow to catch up. Many thanks!

Reason for change: Address the review comments.
Test Procedure: Verify functionality by passing DHCPv6 Option 94 and the ip6tnl tunnel interface is correctly configured and brought up.
Testing Done : Results are captured in RDKBNETWOR-66
Risks: None.

Signed-off-by: Krithiksha Prabhakar <krithiksha.prabhakar@telekom-digital.com>
@Krithiksha11
Copy link
Author

Hi @Krithiksha11 : I just noticed this: If you make any more changes to this PR, please will you fix the headers on the new files you created. They say "this component's Licenses.txt file", but newer headers say "this component's LICENSE file". We changed the license name a long time ago, but headers have been slow to catch up. Many thanks!

Hi @mhughesacn,

I have addressed the requested change. Please review them.

Thank you!

@mhughesacn
Copy link

Looks good - thank you!

@Krithiksha11 Krithiksha11 marked this pull request as ready for review September 9, 2025 04:46
@Krithiksha11 Krithiksha11 requested a review from a team as a code owner September 9, 2025 04:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements MAP-E support in RdkWanManager by adding the capability to receive MAP-E options from DhcpManager and configure the tunnel interface accordingly. The implementation includes creating a new MAP-E configuration module, updating the state machine to handle MAP-E transitions, and providing TR-181 data model support for MAP objects.

  • Unifies MAP-T and MAP-E handling in the WAN interface state machine
  • Adds new MAP-E configuration module with tunnel setup functionality
  • Introduces comprehensive TR-181 data model support for MAP objects

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
source/WanManager/wanmgr_sysevents.h Adds MAP-E feature flag definitions and syscfg variables
source/WanManager/wanmgr_sysevents.c Updates state machine to use unified MAP_ACTIVE state
source/WanManager/wanmgr_net_utils.h Updates function signatures to use unified MAP data structure
source/WanManager/wanmgr_net_utils.c Refactors MAP-T functions to use unified data structure
source/WanManager/wanmgr_mape.h New header defining MAP-E configuration functions
source/WanManager/wanmgr_mape.c New module implementing MAP-E tunnel configuration
source/WanManager/wanmgr_interface_sm.h Adds MAP-E interface status types
source/WanManager/wanmgr_interface_sm.c Implements unified MAP state machine transitions
source/WanManager/wanmgr_dhcpv6_apis.c Updates to use unified MAP data structure
source/WanManager/wanmgr_dhcp_event_handler.c Adds MAP-E event handling support
source/WanManager/wanmgr_data.c Adds MAP data structure initialization
source/WanManager/Makefile.am Includes new MAP-E source file in build
source/TR-181/middle_layer_src/* Complete TR-181 data model implementation for MAP objects
config/RdkWanManager_v2.xml XML configuration for MAP TR-181 objects
NOTICE Updates copyright to include Deutsche Telekom

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

syscfg_unset (NULL, "mape_psid");
syscfg_unset (NULL, "mape_psid_len");
syscfg_unset (NULL, "mape_ipv4_address");
syscfg_unset (NULL, "mape_ipv4_address");
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate syscfg_unset call for 'mape_ipv4_address' on consecutive lines 245 and 246. Remove the duplicate call.

Suggested change
syscfg_unset (NULL, "mape_ipv4_address");

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the duplicate call.

CcspTraceInfo(("%s %d - stop MAP-E\n", __FUNCTION__, __LINE__));

snprintf(cmd, sizeof(cmd), "iproute del default dev %s", p_VirtIf->Name);
system(cmd);
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct system() calls should be replaced with secure_wrapper functions like v_secure_system() for security. The cmd variable on line 346 is constructed from user input and should also use secure execution.

Suggested change
system(cmd);
v_secure_system(cmd);

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced system() with v_secure_system() calls.

Comment on lines 346 to 349
system(cmd);

system("ip link set dev ip6tnl down");
system("ip -6 tunnel del ip6tnl");
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct system() calls should be replaced with secure_wrapper functions like v_secure_system() for security. The cmd variable on line 346 is constructed from user input and should also use secure execution.

Suggested change
system(cmd);
system("ip link set dev ip6tnl down");
system("ip -6 tunnel del ip6tnl");
v_secure_system(cmd);
v_secure_system("ip link set dev ip6tnl down");
v_secure_system("ip -6 tunnel del ip6tnl");

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced system() with v_secure_system() calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants