Skip to content

Commit 8a9e861

Browse files
committed
plugins types UPDATE support new types
... from new revisions of ietf-inet-types and ietf-yang-types.
1 parent 0eda189 commit 8a9e861

35 files changed

Lines changed: 7561 additions & 3768 deletions

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ set(type_plugins
101101
src/plugins_types/ipv4_address_no_zone.c
102102
src/plugins_types/ipv6_address.c
103103
src/plugins_types/ipv6_address_no_zone.c
104-
src/plugins_types/ipv4_prefix.c
105-
src/plugins_types/ipv6_prefix.c
104+
src/plugins_types/ipv4_address_prefix.c
105+
src/plugins_types/ipv6_address_prefix.c
106106
src/plugins_types/date_and_time.c
107+
src/plugins_types/date.c
108+
src/plugins_types/time.c
107109
src/plugins_types/hex_string.c
108110
src/plugins_types/xpath1.0.c
109111
src/plugins_types/node_instanceid.c
@@ -260,6 +262,7 @@ else()
260262
set(INTERNAL_DOCS NO)
261263
endif()
262264

265+
option(ENABLE_DATE_AND_TIME_TYPE_COMPAT "Print ietf-yang-types 'date-and-time' values in an unknown timezone with '-00:00' instead of 'Z'" OFF)
263266
set(LYD_VALUE_SIZE "24" CACHE STRING "Maximum size in bytes of data node values that do not need to be allocated dynamically, minimum is 8")
264267
if(LYD_VALUE_SIZE LESS 8)
265268
message(FATAL_ERROR "Data node value size \"${LYD_VALUE_SIZE}\" is not valid.")

modules/default@2025-06-18.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unsigned char default_2025_06_18_yang[] = {
1+
char default_2025_06_18_yang[] = {
22
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75,
33
0x6c, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73,
44
0x70, 0x61, 0x63, 0x65, 0x20, 0x22, 0x75, 0x72, 0x6e, 0x3a, 0x69, 0x65,

modules/generate_headers.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/env bash
2+
3+
for YANG_FILE in *.yang; do
4+
# generate HEX
5+
HEX=$(echo "$(cat "$YANG_FILE")" | xxd -i)
6+
7+
# generate array name
8+
ARRAY_NAME="$(echo "$YANG_FILE" | tr .@- _)"
9+
10+
# generate header file name with the revision
11+
HEADER_FILE="$(echo "${YANG_FILE%?????}").h"
12+
13+
# print into a C header file
14+
echo -e "char ${ARRAY_NAME}[] = {\n$HEX, 0x00\n};" > "$HEADER_FILE"
15+
done

modules/ietf-datastores@2018-02-14.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unsigned char ietf_datastores_2018_02_14_yang[] = {
1+
char ietf_datastores_2018_02_14_yang[] = {
22
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x69, 0x65, 0x74, 0x66, 0x2d,
33
0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x7b,
44
0x0a, 0x20, 0x20, 0x79, 0x61, 0x6e, 0x67, 0x2d, 0x76, 0x65, 0x72, 0x73,

modules/ietf-inet-types@2013-07-15.h

Lines changed: 0 additions & 1189 deletions
This file was deleted.

0 commit comments

Comments
 (0)