yumapro  25.10-1
YumaPro SDK
Loading...
Searching...
No Matches
udpnotif.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025, YumaWorks, Inc., All Rights Reserved.
3 *
4 * Unless required by applicable law or agreed to in writing,
5 * software distributed under the License is distributed on an
6 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7 * KIND, either express or implied. See the License for the
8 * specific language governing permissions and limitations
9 * under the License.
10 */
11#ifndef _H_udpnotif
12#define _H_udpnotif
13
14/* FILE: udpnotif.h
15*********************************************************************
16* *
17* P U R P O S E *
18* *
19*********************************************************************/
20
27/*********************************************************************
28* *
29* C H A N G E H I S T O R Y *
30* *
31*********************************************************************
32
33date init comment
34----------------------------------------------------------------------
3505-jan-12 abb Begun
36*/
37
38#include "ses.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44/********************************************************************
45* *
46* F U N C T I O N S *
47* *
48*********************************************************************/
49
60/********************************************************************
61* *
62* C O N S T A N T S *
63* *
64*********************************************************************/
65
66#define UDPNOTIF_MIN_HDRSIZE 12
67#define UDPNOTIF_FIXED_HDRSIZE 12
68#define UDPNOTIF_SEGMENT_HDRSIZE 16
69
70#define UDPNOTIF_SEGOPT_TYPE 1
71#define UDPNOTIF_SEGOPT_LEN 4
72
73
74#define UDPNOTIF_PRIVOPT_TYPE 2
75
76
77/********************************************************************
78* *
79* T Y P E S *
80* *
81*********************************************************************/
82
84typedef struct udpnotif_hdr1_t_ {
85
87 uint32 version : 3;
88
90 uint32 space : 1;
91
93 uint32 media_type : 4;
94
96 uint32 hdrlen : 8;
97
99 uint32 msglen : 16;
100
101} YPACK udpnotif_hdr1_t;
102
103
105typedef struct udpnotif_segoption_t_ {
106
108 uint32 type : 8;
109
111 uint32 len : 8;
112
114 uint32 segment : 15;
115
117 uint32 last : 1;
118
120
121
125typedef struct udpnotif_privoption_t_ {
126
128 uint32 type : 8;
129
131 uint32 len : 8;
132
134 uint32 descr : 8;
135
137 uint32 padding : 8;
138
140
141
143typedef union udpnotif_u_hdr1_t_ {
146
148 uint32 u;
150
151
153typedef union udpnotif_u_segopt_t_ {
156
158 uint32 u;
160
161
163typedef struct udpnotif_hdr_t_ {
164
166 uint16 hdrlen;
167
169 uint16 msglen;
170
173
176
178 uint32 segment;
179
181 boolean is_segment;
182
185
188
189} YPACK udpnotif_hdr_t;
190
191
192
203extern status_t
204 udpnotif_get_hdr (const xmlChar *buff,
205 size_t bufflen,
206 udpnotif_hdr_t *rethdr);
207
208
216extern int
217 udpnotif_read (ses_cb_t *scb);
218
219
227extern status_t
229
230
236extern void
238
239
246extern uint32
248
249
257extern dlq_hdr_t *
259 udpnotif_hdr_t *hdr);
260
261
262
269extern const xmlChar *
271
272
280extern void
282 log_debug_t lvl);
283
284
292extern status_t
294
295
299#ifdef __cplusplus
300} /* end extern 'C' */
301#endif
302
303#endif /* _H_udpnotif */
log_debug_t
The debug level enumerations used in util/log.c.
Definition: log.h:348
status_t
global error return code
Definition: status_enum.h:219
status_t udpnotif_init_scb(ses_cb_t *scb)
Init the UDP Collector control blocks in this SCB.
Definition: udpnotif.c:591
status_t udpnotif_setup_new_msg(ses_cb_t *scb)
Init the Collector session for handling a message from the latest publisher.
Definition: udpnotif.c:763
uint32 udpnotif_get_publisher_cnt(const ses_cb_t *scb)
Get the current publisher count.
Definition: udpnotif.c:634
void udpnotif_dump_hdr(const udpnotif_hdr_t *hdr, log_debug_t lvl)
Log the UDP-Notif header if current log-level is lvl or higher.
Definition: udpnotif.c:727
int udpnotif_read(ses_cb_t *scb)
The UDP IO input front-end for UDP-Notif Receiver.
Definition: udpnotif.c:550
status_t udpnotif_get_hdr(const xmlChar *buff, size_t bufflen, udpnotif_hdr_t *rethdr)
FUNCTION udpnotif_get_hdr.
Definition: udpnotif.c:398
const xmlChar * udpnotif_get_print_addr(const ses_cb_t *scb)
The UDP recvaddr print address.
Definition: udpnotif.c:706
dlq_hdr_t * udpnotif_get_msgQ(ses_cb_t *scb, udpnotif_hdr_t *hdr)
The UDP IO input front-end for UDP-Notif Receiver.
Definition: udpnotif.c:657
void udpnotif_clean_scb(ses_cb_t *scb)
Clean the UDP Collector control blocks in this SCB.
Definition: udpnotif.c:615
ncx_msg_encoding_t
enumeration for message encoding formats
Definition: ncxtypes.h:648
NETCONF Session Common definitions module.
Session Control Block.
Definition: ses.h:759
UDP-Notif Header Part 1 (32 bits)
Definition: udpnotif.h:84
uint32 hdrlen
Header Len field : 8 bits : should be 12 or 16.
Definition: udpnotif.h:96
uint32 media_type
MT Media Type field : 4 bits : values 1 - 3 used.
Definition: udpnotif.h:93
uint32 space
S (Space) field: 1 bit : 1=private, 0=standard.
Definition: udpnotif.h:90
uint32 version
Ver field: 3 bits; should be version 1.
Definition: udpnotif.h:87
uint32 msglen
Message Len field : 16 bits.
Definition: udpnotif.h:99
UDP-Notif Header Parsed from Message.
Definition: udpnotif.h:163
uint16 hdrlen
Header Length.
Definition: udpnotif.h:166
uint32 segment
Segment ID starts at 0.
Definition: udpnotif.h:178
uint16 msglen
Message Length.
Definition: udpnotif.h:169
boolean is_last_segment
Is Last Segment Flag.
Definition: udpnotif.h:184
uint32 message_id
Message ID.
Definition: udpnotif.h:175
boolean is_segment
Is Segment Flag.
Definition: udpnotif.h:181
ncx_msg_encoding_t encoding
Converted media type enum.
Definition: udpnotif.h:187
uint32 publisher_id
Publisher ID.
Definition: udpnotif.h:172
UDP-Notif Private Encoding Option Header (maybe more than 32 bits) TBD: NOT SUPPORTED.
Definition: udpnotif.h:125
uint32 len
Length field: 8 bits; any value ??
Definition: udpnotif.h:131
uint32 descr
First byte of the Media Type Description.
Definition: udpnotif.h:134
uint32 padding
Padding for struct alignment.
Definition: udpnotif.h:137
uint32 type
Type field: 8 bits; Assigned in draft (1)
Definition: udpnotif.h:128
UDP-Notif Segmentation Option Header (32 bits)
Definition: udpnotif.h:105
uint32 last
L (Last) field: 1 bit.
Definition: udpnotif.h:117
uint32 len
Length field: 8 bits; fixed value = 4.
Definition: udpnotif.h:111
uint32 segment
Segment Number field: 15 bits.
Definition: udpnotif.h:114
uint32 type
Type field: 8 bits; Assigned in draft (1)
Definition: udpnotif.h:108
UDP-Notif Header Word 1 As Union.
Definition: udpnotif.h:143
udpnotif_hdr1_t f
access header 1 fields
Definition: udpnotif.h:145
uint32 u
access header1 as a uint32 for encoding/decoding
Definition: udpnotif.h:148
UDP-Notif Header SegOption As Union.
Definition: udpnotif.h:153
uint32 u
access segoption as a uint32 for encoding/decoding
Definition: udpnotif.h:158
udpnotif_segoption_t f
access segoption fields
Definition: udpnotif.h:155