Skip to content

Commit 424e069

Browse files
committed
confd: add support for enabling LLDP agent using ieee802-dot1ab-lldp
This patch adds support for enabling LLDP using the std IEEE 802.1ab LLDP yang model. An infix-lldp model is as well to reduce the set of available parameters to a bare minimum (enabled), for now. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent d1c1e7f commit 424e069

File tree

7 files changed

+1942
-1
lines changed

7 files changed

+1942
-1
lines changed

src/confd/confd-bootstrap.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ sysrepoctl -s $SEARCH \
7979
-i infix-if-type@2023-08-21.yang -g wheel -p 0660 \
8080
-i infix-interfaces@2023-08-21.yang -g wheel -p 0660 \
8181
-e vlan-filtering \
82+
-i ieee802-dot1ab-lldp@2022-03-15.yang -g wheel -p 0660 \
83+
-i infix-lldp@2023-08-23.yang -g wheel -p 0660 \
8284
-i infix-dhcp-client@2023-05-22.yang -g wheel -p 0660 \
8385
-i infix-shell-type@2023-08-21.yang -g wheel -p 0660 \
8486
-i infix-system@2023-08-15.yang -g wheel -p 0660 \

src/confd/src/infix-services.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717

1818
static const struct srx_module_requirement reqs[] = {
19-
{ .dir = YANG_PATH_, .name = "infix-services", .rev = "2023-08-22" },
19+
{ .dir = YANG_PATH_, .name = "infix-services", .rev = "2023-08-22" },
20+
{ .dir = YANG_PATH_, .name = "ieee802-dot1ab-lldp", .rev = "2022-03-15" },
21+
{ .dir = YANG_PATH_, .name = "infix-lldp", .rev = "2023-08-23" },
2022
{ NULL }
2123
};
2224

@@ -82,6 +84,12 @@ static int ssdp_change(sr_session_ctx_t *session, uint32_t sub_id, const char *m
8284
return svc_change(session, event, xpath, "ssdp", "ssdpd");
8385
}
8486

87+
static int lldp_change(sr_session_ctx_t *session, uint32_t sub_id, const char *module,
88+
const char *xpath, sr_event_t event, unsigned request_id, void *_confd)
89+
{
90+
return svc_change(session, event, xpath, "lldp", "lldpd");
91+
}
92+
8593
int infix_services_init(struct confd *confd)
8694
{
8795
int rc;
@@ -94,6 +102,9 @@ int infix_services_init(struct confd *confd)
94102
0, mdns_change, confd, &confd->sub);
95103
REGISTER_CHANGE(confd->session, "infix-services", "/infix-services:ssdp",
96104
0, ssdp_change, confd, &confd->sub);
105+
REGISTER_CHANGE(confd->session, "ieee802-dot1ab-lldp", "/ieee802-dot1ab-lldp:lldp",
106+
0, lldp_change, confd, &confd->sub);
107+
97108
return SR_ERR_OK;
98109
fail:
99110
ERROR("init failed: %s", sr_strerror(rc));

0 commit comments

Comments
 (0)