<artifactId>transport-tls</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>transport-udp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- NETCONF Transport features -->
<dependency>
<module>transport-ssh</module>
<module>transport-tcp</module>
<module>transport-tls</module>
+ <module>transport-udp</module>
</modules>
</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2024 PANTHEON.tech, s.r.o. and others. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>netconf-parent</artifactId>
+ <version>8.0.3-SNAPSHOT</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
+
+ <artifactId>transport-udp</artifactId>
+ <name>${project.artifactId}</name>
+ <packaging>bundle</packaging>
+ <description>NETCONF UDP transport</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport-classes-epoll</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jdt</groupId>
+ <artifactId>org.eclipse.jdt.annotation</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.kohsuke.metainf-services</groupId>
+ <artifactId>metainf-services</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>transport-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>mockito-configuration</artifactId>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+/*
+ * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netconf.transport.udp;
+
+import java.util.Set;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.kohsuke.MetaInfServices;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.udp.client.rev241004.IetfUdpClientData;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.udp.client.rev241004.LocalBindingSupported;
+import org.opendaylight.yangtools.binding.YangFeature;
+import org.opendaylight.yangtools.binding.meta.YangFeatureProvider;
+
+/**
+ * Baseline features supported from {@code ietf-udp-client.yang}.
+ */
+@MetaInfServices
+@NonNullByDefault
+public final class IetfUdpClientFeatureProvider implements YangFeatureProvider<IetfUdpClientData> {
+ @Override
+ public Class<IetfUdpClientData> boundModule() {
+ return IetfUdpClientData.class;
+ }
+
+ @Override
+ public Set<? extends YangFeature<?, IetfUdpClientData>> supportedFeatures() {
+ return Set.of(LocalBindingSupported.VALUE);
+ }
+}
--- /dev/null
+module ietf-udp-client {
+ yang-version 1.1;
+ namespace
+ "urn:ietf:params:xml:ns:yang:ietf-udp-client";
+ prefix udpc;
+ import ietf-inet-types {
+ prefix inet;
+ reference
+ "RFC 6991: Common YANG Data Types";
+ }
+
+ organization "IETF NETCONF (Network Configuration) Working Group";
+ contact
+ "WG Web: <http:/tools.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Authors: Alex Huang Feng
+ <mailto:alex.huang-feng@insa-lyon.fr>
+ Pierre Francois
+ <mailto:pierre.francois@insa-lyon.fr>";
+
+ description
+ "Defines a generic grouping for UDP-based client applications.
+
+ Copyright (c) 2024 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, is permitted pursuant to, and subject to the license
+ terms contained in, the Revised BSD License set forth in Section
+ 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
+ (https://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC-to-be; see the RFC
+ itself for full legal notices.";
+
+ revision 2024-10-04 {
+ description
+ "Initial revision";
+ reference
+ "RFC-to-be: YANG Groupings for UDP Clients and UDP Servers";
+ }
+
+ feature local-binding-supported {
+ description
+ "Indicates that the UDP client supports configuring local
+ bindings (i.e., the local address and local port) for
+ UDP clients.";
+ }
+
+ grouping udp-client-grouping {
+ description
+ "A reusable grouping for configuring a UDP client.
+
+ Note that this grouping uses fairly typical descendant
+ node names such that a stack of 'uses' statements will
+ have name conflicts. It is intended that the consuming
+ data model will resolve the issue (e.g., by wrapping
+ the 'uses' statement in a container called
+ 'udp-client-parameters'). This model purposely does
+ not do this itself so as to provide maximum flexibility
+ to consuming models.";
+
+ leaf remote-address {
+ type inet:host;
+ mandatory true;
+ description
+ "The IP address or hostname of the remote UDP server.
+ If a domain name is configured, then the DNS resolution should
+ happen on each connection attempt. If the DNS resolution
+ results in multiple IP addresses, the IP addresses
+ are tried according to local preference order until
+ a connection has been established or until all IP
+ addresses have failed.";
+ }
+
+ leaf remote-port {
+ type inet:port-number;
+ description
+ "The port number of the remote UDP server.";
+ }
+
+ leaf local-address {
+ if-feature "local-binding-supported";
+ type inet:ip-address;
+ description
+ "The local IP address to bind to when sending UDP
+ messages to the remote server. INADDR_ANY ('0.0.0.0') or
+ INADDR6_ANY ('0:0:0:0:0:0:0:0' a.k.a. '::') may be used
+ so that the server can bind to any IPv4 or IPv6 address.";
+ }
+
+ leaf local-port {
+ if-feature "local-binding-supported";
+ type inet:port-number;
+ default "0";
+ description
+ "The local port number to bind to when sending UDP
+ messages to the remote server. The port number '0',
+ which is the default value, indicates that any available
+ local port number may be used.";
+ }
+ }
+}
--- /dev/null
+module ietf-udp-server {
+ yang-version 1.1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-udp-server";
+ prefix udps;
+
+ import ietf-inet-types {
+ prefix inet;
+ reference
+ "RFC 6991: Common YANG Data Types";
+ }
+
+ organization
+ "IETF NETCONF (Network Configuration) Working Group";
+ contact
+ "WG Web: <http:/tools.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Authors: Alex Huang Feng
+ <mailto:alex.huang-feng@insa-lyon.fr>
+ Pierre Francois
+ <mailto:pierre.francois@insa-lyon.fr>";
+ description
+ "Defines a generic grouping for UDP-based server applications.
+
+ Copyright (c) 2024 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, is permitted pursuant to, and subject to the license
+ terms contained in, the Revised BSD License set forth in Section
+ 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
+ (https://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC-to-be; see the RFC
+ itself for full legal notices.";
+
+ revision 2024-10-04 {
+ description
+ "Initial revision";
+ reference
+ "RFC-to-be: YANG Groupings for UDP Clients and UDP Servers";
+ }
+
+ grouping udp-server-grouping {
+ description
+ "Provides a reusable grouping for configuring a UDP server.
+
+ Note that this grouping uses fairly typical descendant
+ node names such that a stack of 'uses' statements will
+ have name conflicts. It is intended that the consuming
+ data model will resolve the issue (e.g., by wrapping
+ the 'uses' statement in a container called
+ 'udp-server-parameters'). This model purposely does
+ not do this itself so as to provide maximum flexibility
+ to consuming models.";
+ list local-bind {
+ key "local-address";
+ min-elements 1;
+ description
+ "A list of bind (listen) points for this server
+ instance. A server instance may have multiple
+ bind points to support, e.g., the same port in
+ different address families or different ports
+ in the same address family.";
+ leaf local-address {
+ type inet:ip-address;
+ mandatory true;
+ description
+ "The local IP address to listen on for incoming
+ UDP messages. To configure listening
+ on all IPv4 addresses the value must be '0.0.0.0'
+ (INADDR_ANY). To configure listening on all IPv6
+ addresses the value must be '::' (INADDR6_ANY).";
+ }
+ leaf local-port {
+ type inet:port-number;
+ description
+ "The local port number to listen on for incoming UDP
+ messages.";
+ }
+ }
+ }
+}