Skip to content

RDKB-61824 : VLAN Discovery Mode#162

Merged
guto86 merged 21 commits into
mainfrom
feature/vlanDiscoveryMode
Nov 6, 2025
Merged

RDKB-61824 : VLAN Discovery Mode#162
guto86 merged 21 commits into
mainfrom
feature/vlanDiscoveryMode

Conversation

@S-Parthiban-Selvaraj
Copy link
Copy Markdown
Contributor

- Added VLAN discovery mode (ALWAYS/ONCE) to allow configurable VLAN discovery behavior.
- Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse.
- Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions.
- Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan.
- Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found.
- Updated structure initializations and state machine transitions to support new VLAN fields and logic.
- Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan).
- Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode.

wanmgr(dhcp): guard MAP-T field in DHCPv6 lease debug print

Wrap the maptAssigned field and its printf argument in copyDhcpv6Data()
with #ifdef FEATURE_MAPT, and adjust the format/argument list accordingly.
This prevents a format/argument mismatch and allows successful compilation
when FEATURE_MAPT is not enabled.

Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
…ent name (#153)

T2 component initialising

Signed-off-by: kavya.shivalingaiah@sky.uk <kavya.shivalingaiah@sky.uk>

---------

Signed-off-by: kavya.shivalingaiah@sky.uk <kavya.shivalingaiah@sky.uk>
* RDKB-61835 : Update Ipv6 sysevents when Ipv6 configured.

Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>

* Changing buffer size

---------

Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
- Added VLAN discovery mode (ALWAYS/ONCE) to allow configurable VLAN discovery behavior.
- Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse.
- Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions.
- Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan.
- Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found.
- Updated structure initializations and state machine transitions to support new VLAN fields and logic.
- Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan).
- Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode.

Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Copilot AI review requested due to automatic review settings November 4, 2025 11:26
@S-Parthiban-Selvaraj S-Parthiban-Selvaraj marked this pull request as ready for review November 4, 2025 11:27
@S-Parthiban-Selvaraj S-Parthiban-Selvaraj requested a review from a team as a code owner November 4, 2025 11:27
Copy link
Copy Markdown
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 introduces configurable VLAN discovery behavior by adding a discovery mode (ALWAYS/ONCE) and refactors VLAN tracking to use CurrentVlan for active operations while preserving VLANInUse for persistence. The changes ensure VLAN discovery logic respects the configured mode and prevents redundant discovery attempts when a VLAN has already been found.

Key changes:

  • Added VLAN_DISCOVERY_MODE enum and DiscoveryMode field to support ALWAYS/ONCE discovery modes
  • Introduced CurrentVlan field to track the actively used/tried VLAN during state transitions, separate from persisted VLANInUse
  • Refactored VLAN logic throughout the state machine to use CurrentVlan and conditionally persist to VLANInUse

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
source/WanManager/wanmgr_main.c Moved t2_init call earlier in initialization sequence
source/WanManager/wanmgr_interface_sm.c Updated VLAN state machine logic to use CurrentVlan, implemented discovery mode checks, and refactored IPv6 setup sysevent calls
source/WanManager/wanmgr_dhcp_event_handler.c Added conditional compilation for FEATURE_MAPT in logging
source/WanManager/wanmgr_data.c Initialized new CurrentVlan and VlanDiscoveryMode fields in virtual interface structure
source/TR-181/middle_layer_src/wanmgr_rdkbus_utils.c Updated RDKBus API calls to use CurrentVlan instead of VLANInUse
source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.h Renamed function and added documentation for UpdateAndPersisteVLANInUse
source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c Implemented conditional persistence logic in UpdateAndPersisteVLANInUse and added PSM retrieval for DiscoveryMode
source/TR-181/include/wanmgr_dml.h Added VLAN_DISCOVERY_MODE enum, CurrentVlan field, and DiscoveryMode field to VLAN structure
source/TR-181/include/dmsb_tr181_psm_definitions.h Added PSM definition for VLAN discovery mode parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c
Comment thread source/TR-181/include/wanmgr_dml.h
Comment thread source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.h Outdated
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
…al/wan-manager into feature/vlanDiscoveryMode
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Copilot AI review requested due to automatic review settings November 4, 2025 11:46
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Copilot AI review requested due to automatic review settings November 4, 2025 11:51
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/WanManager/wanmgr_interface_sm.c Outdated
if(strlen(p_VirtIf->VLAN.VlanInUse) > 0)
{
CcspTraceInfo(("%s %d - interface %s : using previously found VLAN %s\n", __FUNCTION__, __LINE__, p_VirtIf->Name, p_VirtIf->VLAN.VlanInUse));
strncpy(p_VirtIf->VLAN.CurrentVlan, p_VirtIf->VLAN.VlanInUse, sizeof(p_VirtIf->VLAN.CurrentVlan));
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

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

strncpy does not guarantee null-termination if the source string length equals or exceeds the destination buffer size. Use snprintf or explicitly null-terminate after strncpy to prevent potential buffer overrun issues.

Copilot uses AI. Check for mistakes.
Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c
Comment thread source/TR-181/include/wanmgr_dml.h Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 4, 2025 12:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/WanManager/wanmgr_interface_sm.c Outdated
Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c
…discovery behavior.

- Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse.
- Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions.
- Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan.
- Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found.
- Updated structure initializations and state machine transitions to support new VLAN fields and logic.
- Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan).
- Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode.

Signed-off-by: LakshminarayananShenbagaraj <lakshminarayanan.shenbagaraj2@sky.uk>
…discovery behavior.

- Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse.
- Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions.
- Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan.
- Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found.
- Updated structure initializations and state machine transitions to support new VLAN fields and logic.
- Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan).
- Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode.

Signed-off-by: LakshminarayananShenbagaraj <lakshminarayanan.shenbagaraj2@sky.uk>
Copilot AI review requested due to automatic review settings November 4, 2025 12:38
Copy link
Copy Markdown
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/WanManager/wanmgr_interface_sm.c Outdated
Comment thread source/WanManager/wanmgr_interface_sm.c Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 4, 2025 15:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/TR-181/include/wanmgr_dml.h Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 4, 2025 15:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Copilot AI review requested due to automatic review settings November 5, 2025 10:44
Copy link
Copy Markdown
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/WanManager/wanmgr_interface_sm.c
Comment thread source/TR-181/middle_layer_src/wanmgr_dml_iface_v2_apis.c
…discovery behavior.

- Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse.
- Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions.
- Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan.
- Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found.
- Updated structure initializations and state machine transitions to support new VLAN fields and logic.
- Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan).
- Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode.

Signed-off-by: LakshminarayananShenbagaraj <lakshminarayanan.shenbagaraj2@sky.uk>
@guto86 guto86 merged commit 2ebde10 into main Nov 6, 2025
6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2025
@S-Parthiban-Selvaraj S-Parthiban-Selvaraj deleted the feature/vlanDiscoveryMode branch January 19, 2026 13:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants