Skip to main content

netgauze_yang_push/
lib.rs

1// Copyright (C) 2025-present The NetGauze Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//    http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12// implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16//! # Overview
17//!
18//! This module defines the constants and types relevant to the NetGauze UDP
19//! notification handling system using YANG push subscriptions.
20//! # Exports and Definitions
21//!
22//! ## Submodules
23//! - [cache]: Expected to define and handle caching mechanisms for the system.
24//! - [model]: Contains the data models or structures used IETF Telemetry
25//!   Message.
26//! - [validation]: Implements validation mechanisms for YANG Push messages.
27//!
28//! ## Type Definitions
29//! - `ContentId`: A `String` type alias representing the identifier for content
30//!   within the notification system.
31
32pub mod cache;
33pub mod model;
34pub mod validation;
35
36/// A String type alias representing the Content ID in YANG Library
37/// [RFC8525](https://datatracker.ietf.org/doc/html/rfc8525).
38pub type ContentId = String;
39
40pub const OTL_YANG_PUSH_SUBSCRIPTION_ID_KEY: &str = "netgauze.udp.notif.yang.push.subscription.id";
41pub const OTL_YANG_PUSH_SUBSCRIPTION_TARGET_KEY: &str =
42    "netgauze.udp.notif.yang.push.subscription.target";
43pub const OTL_YANG_PUSH_SUBSCRIPTION_ROUTER_CONTENT_ID_KEY: &str =
44    "netgauze.udp.notif.yang.push.subscription.router_content_id";
45pub const OTL_YANG_PUSH_CACHED_CONTENT_ID_KEY: &str =
46    "netgauze.udp.notif.yang.push.subscription.cached_content_id";
47const OTL_CACHE_DROP_REASON_KEY: &str = "netgauze.udp.notif.yang.push.cache.drop.reason";
48const OTL_CACHE_DROP_REASON_SUBSCRIPTION_CACHE_FULL: &str = "subscription cache is full";
49const OTL_CACHE_DROP_REASON_PEER_CACHE_FULL: &str = "peer cache is full";
50const OTL_YANG_PUSH_DECODE_ERROR_ID_KEY: &str = "netgauze.udp.notif.yang.push.decode.error";