Debian Codegraph @

agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c

raw
1 /*
2 * Note: this file originally auto-generated by mib2c using
3 * version : 12088 $ of $
4 *
5 * $Id:$
6 */
7 /*
8 * standard Net-SNMP includes
9 */
10 #include <net-snmp/net-snmp-config.h>
11 #include <net-snmp/net-snmp-includes.h>
12 #include <net-snmp/agent/net-snmp-agent-includes.h>
13
14 /*
15 * include our parent header
16 */
17 #include "etherStatsTable.h"
18
19
20 /** @defgroup data_get data_get: Routines to get data
21 *
22 * TODO:230:M: Implement etherStatsTable get routines.
23 * TODO:240:M: Implement etherStatsTable mapping routines (if any).
24 *
25 * These routine are used to get the value for individual objects. The
26 * row context is passed, along with a pointer to the memory where the
27 * value should be copied.
28 *
29 * @{
30 */
31 /**********************************************************************
32 **********************************************************************
33 ***
34 *** Table etherStatsTable
35 ***
36 **********************************************************************
37 **********************************************************************/
38 /*
39 * RMON-MIB::etherStatsTable is subid 1 of statistics.
40 * Its status is Current.
41 * OID: .1.3.6.1.2.1.16.1.1, length: 9
42 */
43
44 /*
45 * ---------------------------------------------------------------------
46 * * TODO:200:r: Implement etherStatsTable data context functions.
47 */
48
49
50 /**
51 * set mib index(es)
52 *
53 * @param tbl_idx mib index structure
54 * @param etherStatsIndex_val
55 *
56 * @retval MFD_SUCCESS : success.
57 * @retval MFD_ERROR : other error.
58 *
59 * @remark
60 * This convenience function is useful for setting all the MIB index
61 * components with a single function call. It is assume that the C values
62 * have already been mapped from their native/rawformat to the MIB format.
63 */
64 int
65 etherStatsTable_indexes_set_tbl_idx(etherStatsTable_mib_index * tbl_idx,
66 long etherStatsIndex_val)
67 {
68 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_indexes_set_tbl_idx", "called\n"));
69
70 /*
71 * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
72 */
73 tbl_idx->etherStatsIndex = etherStatsIndex_val;
74
75
76 return MFD_SUCCESS;
77 } /* etherStatsTable_indexes_set_tbl_idx */
78
79 /**
80 * @internal
81 * set row context indexes
82 *
83 * @param reqreq_ctx the row context that needs updated indexes
84 *
85 * @retval MFD_SUCCESS : success.
86 * @retval MFD_ERROR : other error.
87 *
88 * @remark
89 * This function sets the mib indexs, then updates the oid indexs
90 * from the mib index.
91 */
92 int
93 etherStatsTable_indexes_set(etherStatsTable_rowreq_ctx * rowreq_ctx,
94 long etherStatsIndex_val)
95 {
96 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_indexes_set",
97 "called\n"));
98
99 if (MFD_SUCCESS !=
100 etherStatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
101 etherStatsIndex_val))
102 return MFD_ERROR;
103
104 /*
105 * convert mib index to oid index
106 */
107 rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
108 if (0 != etherStatsTable_index_to_oid(&rowreq_ctx->oid_idx,
109 &rowreq_ctx->tbl_idx)) {
110 return MFD_ERROR;
111 }
112
113 return MFD_SUCCESS;
114 } /* etherStatsTable_indexes_set */
115
116
117 /*---------------------------------------------------------------------
118 * RMON-MIB::etherStatsEntry.etherStatsDataSource
119 * etherStatsDataSource is subid 2 of etherStatsEntry.
120 * Its status is Current, and its access level is Create.
121 * OID: .1.3.6.1.2.1.16.1.1.1.2
122 * Description:
123 This object identifies the source of the data that
124 this etherStats entry is configured to analyze. This
125 source can be any ethernet interface on this device.
126 In order to identify a particular interface, this object
127 shall identify the instance of the ifIndex object,
128 defined in RFC 2233 [17], for the desired interface.
129 For example, if an entry were to receive data from
130 interface #1, this object would be set to ifIndex.1.
131
132 The statistics in this group reflect all packets
133 on the local network segment attached to the identified
134 interface.
135
136 An agent may or may not be able to tell if fundamental
137 changes to the media of the interface have occurred and
138 necessitate an invalidation of this entry. For example, a
139 hot-pluggable ethernet card could be pulled out and replaced
140 by a token-ring card. In such a case, if the agent has such
141 knowledge of the change, it is recommended that it
142 invalidate this entry.
143
144 This object may not be modified if the associated
145 etherStatsStatus object is equal to valid(1).
146 *
147 * Attributes:
148 * accessible 1 isscalar 0 enums 0 hasdefval 0
149 * readable 1 iscolumn 1 ranges 0 hashint 0
150 * settable 1
151 *
152 *
153 * Its syntax is OBJECTID (based on perltype OBJECTID)
154 * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
155 * This data type requires a length.
156 */
157 /**
158 * Extract the current value of the etherStatsDataSource data.
159 *
160 * Set a value using the data context for the row.
161 *
162 * @param rowreq_ctx
163 * Pointer to the row request context.
164 * @param etherStatsDataSource_val_ptr_ptr
165 * Pointer to storage for a oid variable
166 * @param etherStatsDataSource_val_ptr_len_ptr
167 * Pointer to a size_t. On entry, it will contain the size (in bytes)
168 * pointed to by etherStatsDataSource.
169 * On exit, this value should contain the data size (in bytes).
170 *
171 * @retval MFD_SUCCESS : success
172 * @retval MFD_SKIP : skip this node (no value for now)
173 * @retval MFD_ERROR : Any other error
174 *
175 * @note If you need more than (*etherStatsDataSource_val_ptr_len_ptr) bytes of memory,
176 * allocate it using malloc() and update etherStatsDataSource_val_ptr_ptr.
177 * <b>DO NOT</b> free the previous pointer.
178 * The MFD helper will release the memory you allocate.
179 *
180 * @remark If you call this function yourself, you are responsible
181 * for checking if the pointer changed, and freeing any
182 * previously allocated memory. (Not necessary if you pass
183 * in a pointer to static memory, obviously.)
184 */
185 int
186 etherStatsDataSource_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
187 oid ** etherStatsDataSource_val_ptr_ptr,
188 size_t *etherStatsDataSource_val_ptr_len_ptr)
189 {
190 /** we should have a non-NULL pointer and enough storage */
191 netsnmp_assert((NULL != etherStatsDataSource_val_ptr_ptr)
192 && (NULL != *etherStatsDataSource_val_ptr_ptr));
193 netsnmp_assert(NULL != etherStatsDataSource_val_ptr_len_ptr);
194
195
196 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_get",
197 "called\n"));
198
199 netsnmp_assert(NULL != rowreq_ctx);
200
201 /*
202 * TODO:231:o: |-> Extract the current value of the etherStatsDataSource data.
203 * copy (* etherStatsDataSource_val_ptr_ptr ) data and (* etherStatsDataSource_val_ptr_len_ptr ) from rowreq_ctx->data
204 */
205 /*
206 * make sure there is enough space for etherStatsDataSource data
207 */
208 if ((NULL == (*etherStatsDataSource_val_ptr_ptr)) ||
209 ((*etherStatsDataSource_val_ptr_len_ptr) <
210 (rowreq_ctx->data.etherStatsDataSource_len *
211 sizeof(rowreq_ctx->data.etherStatsDataSource[0])))) {
212 /*
213 * allocate space for etherStatsDataSource data
214 */
215 (*etherStatsDataSource_val_ptr_ptr) =
216 malloc(rowreq_ctx->data.etherStatsDataSource_len *
217 sizeof(rowreq_ctx->data.etherStatsDataSource[0]));
218 if (NULL == (*etherStatsDataSource_val_ptr_ptr)) {
219 snmp_log(LOG_ERR, "could not allocate memory\n");
220 return MFD_ERROR;
221 }
222 }
223 (*etherStatsDataSource_val_ptr_len_ptr) =
224 rowreq_ctx->data.etherStatsDataSource_len *
225 sizeof(rowreq_ctx->data.etherStatsDataSource[0]);
226 memcpy((*etherStatsDataSource_val_ptr_ptr),
227 rowreq_ctx->data.etherStatsDataSource,
228 rowreq_ctx->data.etherStatsDataSource_len *
229 sizeof(rowreq_ctx->data.etherStatsDataSource[0]));
230
231 return MFD_SUCCESS;
232 } /* etherStatsDataSource_get */
233
234 /*---------------------------------------------------------------------
235 * RMON-MIB::etherStatsEntry.etherStatsDropEvents
236 * etherStatsDropEvents is subid 3 of etherStatsEntry.
237 * Its status is Current, and its access level is ReadOnly.
238 * OID: .1.3.6.1.2.1.16.1.1.1.3
239 * Description:
240 The total number of events in which packets
241 were dropped by the probe due to lack of resources.
242 Note that this number is not necessarily the number of
243 packets dropped; it is just the number of times this
244 condition has been detected.
245 *
246 * Attributes:
247 * accessible 1 isscalar 0 enums 0 hasdefval 0
248 * readable 1 iscolumn 1 ranges 0 hashint 0
249 * settable 0
250 *
251 *
252 * Its syntax is COUNTER (based on perltype COUNTER)
253 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
254 */
255 /**
256 * Extract the current value of the etherStatsDropEvents data.
257 *
258 * Set a value using the data context for the row.
259 *
260 * @param rowreq_ctx
261 * Pointer to the row request context.
262 * @param etherStatsDropEvents_val_ptr
263 * Pointer to storage for a u_long variable
264 *
265 * @retval MFD_SUCCESS : success
266 * @retval MFD_SKIP : skip this node (no value for now)
267 * @retval MFD_ERROR : Any other error
268 */
269 int
270 etherStatsDropEvents_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
271 u_long * etherStatsDropEvents_val_ptr)
272 {
273 /** we should have a non-NULL pointer */
274 netsnmp_assert(NULL != etherStatsDropEvents_val_ptr);
275
276
277 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDropEvents_get",
278 "called\n"));
279
280 netsnmp_assert(NULL != rowreq_ctx);
281
282 /*
283 * TODO:231:o: |-> Extract the current value of the etherStatsDropEvents data.
284 * copy (* etherStatsDropEvents_val_ptr ) from rowreq_ctx->data
285 */
286 (*etherStatsDropEvents_val_ptr) =
287 rowreq_ctx->data.etherStatsDropEvents;
288
289 return MFD_SUCCESS;
290 } /* etherStatsDropEvents_get */
291
292 /*---------------------------------------------------------------------
293 * RMON-MIB::etherStatsEntry.etherStatsOctets
294 * etherStatsOctets is subid 4 of etherStatsEntry.
295 * Its status is Current, and its access level is ReadOnly.
296 * OID: .1.3.6.1.2.1.16.1.1.1.4
297 * Description:
298 The total number of octets of data (including
299 those in bad packets) received on the
300 network (excluding framing bits but including
301 FCS octets).
302
303 This object can be used as a reasonable estimate of
304 10-Megabit ethernet utilization. If greater precision is
305 desired, the etherStatsPkts and etherStatsOctets objects
306 should be sampled before and after a common interval. The
307 differences in the sampled values are Pkts and Octets,
308 respectively, and the number of seconds in the interval is
309 Interval. These values are used to calculate the Utilization
310 as follows:
311
312 Pkts * (9.6 + 6.4) + (Octets * .8)
313 Utilization = -------------------------------------
314 Interval * 10,000
315
316 The result of this equation is the value Utilization which
317 is the percent utilization of the ethernet segment on a
318 scale of 0 to 100 percent.
319 *
320 * Attributes:
321 * accessible 1 isscalar 0 enums 0 hasdefval 0
322 * readable 1 iscolumn 1 ranges 0 hashint 0
323 * settable 0
324 *
325 *
326 * Its syntax is COUNTER (based on perltype COUNTER)
327 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
328 */
329 /**
330 * Extract the current value of the etherStatsOctets data.
331 *
332 * Set a value using the data context for the row.
333 *
334 * @param rowreq_ctx
335 * Pointer to the row request context.
336 * @param etherStatsOctets_val_ptr
337 * Pointer to storage for a u_long variable
338 *
339 * @retval MFD_SUCCESS : success
340 * @retval MFD_SKIP : skip this node (no value for now)
341 * @retval MFD_ERROR : Any other error
342 */
343 int
344 etherStatsOctets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
345 u_long * etherStatsOctets_val_ptr)
346 {
347 /** we should have a non-NULL pointer */
348 netsnmp_assert(NULL != etherStatsOctets_val_ptr);
349
350
351 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOctets_get",
352 "called\n"));
353
354 netsnmp_assert(NULL != rowreq_ctx);
355
356 /*
357 * TODO:231:o: |-> Extract the current value of the etherStatsOctets data.
358 * copy (* etherStatsOctets_val_ptr ) from rowreq_ctx->data
359 */
360 (*etherStatsOctets_val_ptr) = rowreq_ctx->data.etherStatsOctets;
361
362 return MFD_SUCCESS;
363 } /* etherStatsOctets_get */
364
365 /*---------------------------------------------------------------------
366 * RMON-MIB::etherStatsEntry.etherStatsPkts
367 * etherStatsPkts is subid 5 of etherStatsEntry.
368 * Its status is Current, and its access level is ReadOnly.
369 * OID: .1.3.6.1.2.1.16.1.1.1.5
370 * Description:
371 The total number of packets (including bad packets,
372 broadcast packets, and multicast packets) received.
373 *
374 * Attributes:
375 * accessible 1 isscalar 0 enums 0 hasdefval 0
376 * readable 1 iscolumn 1 ranges 0 hashint 0
377 * settable 0
378 *
379 *
380 * Its syntax is COUNTER (based on perltype COUNTER)
381 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
382 */
383 /**
384 * Extract the current value of the etherStatsPkts data.
385 *
386 * Set a value using the data context for the row.
387 *
388 * @param rowreq_ctx
389 * Pointer to the row request context.
390 * @param etherStatsPkts_val_ptr
391 * Pointer to storage for a u_long variable
392 *
393 * @retval MFD_SUCCESS : success
394 * @retval MFD_SKIP : skip this node (no value for now)
395 * @retval MFD_ERROR : Any other error
396 */
397 int
398 etherStatsPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
399 u_long * etherStatsPkts_val_ptr)
400 {
401 /** we should have a non-NULL pointer */
402 netsnmp_assert(NULL != etherStatsPkts_val_ptr);
403
404
405 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts_get", "called\n"));
406
407 netsnmp_assert(NULL != rowreq_ctx);
408
409 /*
410 * TODO:231:o: |-> Extract the current value of the etherStatsPkts data.
411 * copy (* etherStatsPkts_val_ptr ) from rowreq_ctx->data
412 */
413 (*etherStatsPkts_val_ptr) = rowreq_ctx->data.etherStatsPkts;
414
415 return MFD_SUCCESS;
416 } /* etherStatsPkts_get */
417
418 /*---------------------------------------------------------------------
419 * RMON-MIB::etherStatsEntry.etherStatsBroadcastPkts
420 * etherStatsBroadcastPkts is subid 6 of etherStatsEntry.
421 * Its status is Current, and its access level is ReadOnly.
422 * OID: .1.3.6.1.2.1.16.1.1.1.6
423 * Description:
424 The total number of good packets received that were
425 directed to the broadcast address. Note that this
426 does not include multicast packets.
427 *
428 * Attributes:
429 * accessible 1 isscalar 0 enums 0 hasdefval 0
430 * readable 1 iscolumn 1 ranges 0 hashint 0
431 * settable 0
432 *
433 *
434 * Its syntax is COUNTER (based on perltype COUNTER)
435 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
436 */
437 /**
438 * Extract the current value of the etherStatsBroadcastPkts data.
439 *
440 * Set a value using the data context for the row.
441 *
442 * @param rowreq_ctx
443 * Pointer to the row request context.
444 * @param etherStatsBroadcastPkts_val_ptr
445 * Pointer to storage for a u_long variable
446 *
447 * @retval MFD_SUCCESS : success
448 * @retval MFD_SKIP : skip this node (no value for now)
449 * @retval MFD_ERROR : Any other error
450 */
451 int
452 etherStatsBroadcastPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
453 u_long * etherStatsBroadcastPkts_val_ptr)
454 {
455 /** we should have a non-NULL pointer */
456 netsnmp_assert(NULL != etherStatsBroadcastPkts_val_ptr);
457
458
459 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsBroadcastPkts_get",
460 "called\n"));
461
462 netsnmp_assert(NULL != rowreq_ctx);
463
464 /*
465 * TODO:231:o: |-> Extract the current value of the etherStatsBroadcastPkts data.
466 * copy (* etherStatsBroadcastPkts_val_ptr ) from rowreq_ctx->data
467 */
468 (*etherStatsBroadcastPkts_val_ptr) =
469 rowreq_ctx->data.etherStatsBroadcastPkts;
470
471 return MFD_SUCCESS;
472 } /* etherStatsBroadcastPkts_get */
473
474 /*---------------------------------------------------------------------
475 * RMON-MIB::etherStatsEntry.etherStatsMulticastPkts
476 * etherStatsMulticastPkts is subid 7 of etherStatsEntry.
477 * Its status is Current, and its access level is ReadOnly.
478 * OID: .1.3.6.1.2.1.16.1.1.1.7
479 * Description:
480 The total number of good packets received that were
481 directed to a multicast address. Note that this number
482 does not include packets directed to the broadcast
483
484 address.
485 *
486 * Attributes:
487 * accessible 1 isscalar 0 enums 0 hasdefval 0
488 * readable 1 iscolumn 1 ranges 0 hashint 0
489 * settable 0
490 *
491 *
492 * Its syntax is COUNTER (based on perltype COUNTER)
493 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
494 */
495 /**
496 * Extract the current value of the etherStatsMulticastPkts data.
497 *
498 * Set a value using the data context for the row.
499 *
500 * @param rowreq_ctx
501 * Pointer to the row request context.
502 * @param etherStatsMulticastPkts_val_ptr
503 * Pointer to storage for a u_long variable
504 *
505 * @retval MFD_SUCCESS : success
506 * @retval MFD_SKIP : skip this node (no value for now)
507 * @retval MFD_ERROR : Any other error
508 */
509 int
510 etherStatsMulticastPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
511 u_long * etherStatsMulticastPkts_val_ptr)
512 {
513 /** we should have a non-NULL pointer */
514 netsnmp_assert(NULL != etherStatsMulticastPkts_val_ptr);
515
516
517 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsMulticastPkts_get",
518 "called\n"));
519
520 netsnmp_assert(NULL != rowreq_ctx);
521
522 /*
523 * TODO:231:o: |-> Extract the current value of the etherStatsMulticastPkts data.
524 * copy (* etherStatsMulticastPkts_val_ptr ) from rowreq_ctx->data
525 */
526 (*etherStatsMulticastPkts_val_ptr) =
527 rowreq_ctx->data.etherStatsMulticastPkts;
528
529 return MFD_SUCCESS;
530 } /* etherStatsMulticastPkts_get */
531
532 /*---------------------------------------------------------------------
533 * RMON-MIB::etherStatsEntry.etherStatsCRCAlignErrors
534 * etherStatsCRCAlignErrors is subid 8 of etherStatsEntry.
535 * Its status is Current, and its access level is ReadOnly.
536 * OID: .1.3.6.1.2.1.16.1.1.1.8
537 * Description:
538 The total number of packets received that
539 had a length (excluding framing bits, but
540 including FCS octets) of between 64 and 1518
541 octets, inclusive, but had either a bad
542 Frame Check Sequence (FCS) with an integral
543 number of octets (FCS Error) or a bad FCS with
544 a non-integral number of octets (Alignment Error).
545 *
546 * Attributes:
547 * accessible 1 isscalar 0 enums 0 hasdefval 0
548 * readable 1 iscolumn 1 ranges 0 hashint 0
549 * settable 0
550 *
551 *
552 * Its syntax is COUNTER (based on perltype COUNTER)
553 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
554 */
555 /**
556 * Extract the current value of the etherStatsCRCAlignErrors data.
557 *
558 * Set a value using the data context for the row.
559 *
560 * @param rowreq_ctx
561 * Pointer to the row request context.
562 * @param etherStatsCRCAlignErrors_val_ptr
563 * Pointer to storage for a u_long variable
564 *
565 * @retval MFD_SUCCESS : success
566 * @retval MFD_SKIP : skip this node (no value for now)
567 * @retval MFD_ERROR : Any other error
568 */
569 int
570 etherStatsCRCAlignErrors_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
571 u_long * etherStatsCRCAlignErrors_val_ptr)
572 {
573 /** we should have a non-NULL pointer */
574 netsnmp_assert(NULL != etherStatsCRCAlignErrors_val_ptr);
575
576
577 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsCRCAlignErrors_get",
578 "called\n"));
579
580 netsnmp_assert(NULL != rowreq_ctx);
581
582 /*
583 * TODO:231:o: |-> Extract the current value of the etherStatsCRCAlignErrors data.
584 * copy (* etherStatsCRCAlignErrors_val_ptr ) from rowreq_ctx->data
585 */
586 (*etherStatsCRCAlignErrors_val_ptr) =
587 rowreq_ctx->data.etherStatsCRCAlignErrors;
588
589 return MFD_SUCCESS;
590 } /* etherStatsCRCAlignErrors_get */
591
592 /*---------------------------------------------------------------------
593 * RMON-MIB::etherStatsEntry.etherStatsUndersizePkts
594 * etherStatsUndersizePkts is subid 9 of etherStatsEntry.
595 * Its status is Current, and its access level is ReadOnly.
596 * OID: .1.3.6.1.2.1.16.1.1.1.9
597 * Description:
598 The total number of packets received that were
599 less than 64 octets long (excluding framing bits,
600 but including FCS octets) and were otherwise well
601 formed.
602 *
603 * Attributes:
604 * accessible 1 isscalar 0 enums 0 hasdefval 0
605 * readable 1 iscolumn 1 ranges 0 hashint 0
606 * settable 0
607 *
608 *
609 * Its syntax is COUNTER (based on perltype COUNTER)
610 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
611 */
612 /**
613 * Extract the current value of the etherStatsUndersizePkts data.
614 *
615 * Set a value using the data context for the row.
616 *
617 * @param rowreq_ctx
618 * Pointer to the row request context.
619 * @param etherStatsUndersizePkts_val_ptr
620 * Pointer to storage for a u_long variable
621 *
622 * @retval MFD_SUCCESS : success
623 * @retval MFD_SKIP : skip this node (no value for now)
624 * @retval MFD_ERROR : Any other error
625 */
626 int
627 etherStatsUndersizePkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
628 u_long * etherStatsUndersizePkts_val_ptr)
629 {
630 /** we should have a non-NULL pointer */
631 netsnmp_assert(NULL != etherStatsUndersizePkts_val_ptr);
632
633
634 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsUndersizePkts_get",
635 "called\n"));
636
637 netsnmp_assert(NULL != rowreq_ctx);
638
639 /*
640 * TODO:231:o: |-> Extract the current value of the etherStatsUndersizePkts data.
641 * copy (* etherStatsUndersizePkts_val_ptr ) from rowreq_ctx->data
642 */
643 (*etherStatsUndersizePkts_val_ptr) =
644 rowreq_ctx->data.etherStatsUndersizePkts;
645
646 return MFD_SUCCESS;
647 } /* etherStatsUndersizePkts_get */
648
649 /*---------------------------------------------------------------------
650 * RMON-MIB::etherStatsEntry.etherStatsOversizePkts
651 * etherStatsOversizePkts is subid 10 of etherStatsEntry.
652 * Its status is Current, and its access level is ReadOnly.
653 * OID: .1.3.6.1.2.1.16.1.1.1.10
654 * Description:
655 The total number of packets received that were
656 longer than 1518 octets (excluding framing bits,
657 but including FCS octets) and were otherwise
658 well formed.
659 *
660 * Attributes:
661 * accessible 1 isscalar 0 enums 0 hasdefval 0
662 * readable 1 iscolumn 1 ranges 0 hashint 0
663 * settable 0
664 *
665 *
666 * Its syntax is COUNTER (based on perltype COUNTER)
667 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
668 */
669 /**
670 * Extract the current value of the etherStatsOversizePkts data.
671 *
672 * Set a value using the data context for the row.
673 *
674 * @param rowreq_ctx
675 * Pointer to the row request context.
676 * @param etherStatsOversizePkts_val_ptr
677 * Pointer to storage for a u_long variable
678 *
679 * @retval MFD_SUCCESS : success
680 * @retval MFD_SKIP : skip this node (no value for now)
681 * @retval MFD_ERROR : Any other error
682 */
683 int
684 etherStatsOversizePkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
685 u_long * etherStatsOversizePkts_val_ptr)
686 {
687 /** we should have a non-NULL pointer */
688 netsnmp_assert(NULL != etherStatsOversizePkts_val_ptr);
689
690
691 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOversizePkts_get",
692 "called\n"));
693
694 netsnmp_assert(NULL != rowreq_ctx);
695
696 /*
697 * TODO:231:o: |-> Extract the current value of the etherStatsOversizePkts data.
698 * copy (* etherStatsOversizePkts_val_ptr ) from rowreq_ctx->data
699 */
700 (*etherStatsOversizePkts_val_ptr) =
701 rowreq_ctx->data.etherStatsOversizePkts;
702
703 return MFD_SUCCESS;
704 } /* etherStatsOversizePkts_get */
705
706 /*---------------------------------------------------------------------
707 * RMON-MIB::etherStatsEntry.etherStatsFragments
708 * etherStatsFragments is subid 11 of etherStatsEntry.
709 * Its status is Current, and its access level is ReadOnly.
710 * OID: .1.3.6.1.2.1.16.1.1.1.11
711 * Description:
712 The total number of packets received that were less than
713 64 octets in length (excluding framing bits but including
714 FCS octets) and had either a bad Frame Check Sequence
715 (FCS) with an integral number of octets (FCS Error) or a
716 bad FCS with a non-integral number of octets (Alignment
717 Error).
718
719 Note that it is entirely normal for etherStatsFragments to
720 increment. This is because it counts both runts (which are
721 normal occurrences due to collisions) and noise hits.
722 *
723 * Attributes:
724 * accessible 1 isscalar 0 enums 0 hasdefval 0
725 * readable 1 iscolumn 1 ranges 0 hashint 0
726 * settable 0
727 *
728 *
729 * Its syntax is COUNTER (based on perltype COUNTER)
730 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
731 */
732 /**
733 * Extract the current value of the etherStatsFragments data.
734 *
735 * Set a value using the data context for the row.
736 *
737 * @param rowreq_ctx
738 * Pointer to the row request context.
739 * @param etherStatsFragments_val_ptr
740 * Pointer to storage for a u_long variable
741 *
742 * @retval MFD_SUCCESS : success
743 * @retval MFD_SKIP : skip this node (no value for now)
744 * @retval MFD_ERROR : Any other error
745 */
746 int
747 etherStatsFragments_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
748 u_long * etherStatsFragments_val_ptr)
749 {
750 /** we should have a non-NULL pointer */
751 netsnmp_assert(NULL != etherStatsFragments_val_ptr);
752
753
754 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsFragments_get",
755 "called\n"));
756
757 netsnmp_assert(NULL != rowreq_ctx);
758
759 /*
760 * TODO:231:o: |-> Extract the current value of the etherStatsFragments data.
761 * copy (* etherStatsFragments_val_ptr ) from rowreq_ctx->data
762 */
763 (*etherStatsFragments_val_ptr) = rowreq_ctx->data.etherStatsFragments;
764
765 return MFD_SUCCESS;
766 } /* etherStatsFragments_get */
767
768 /*---------------------------------------------------------------------
769 * RMON-MIB::etherStatsEntry.etherStatsJabbers
770 * etherStatsJabbers is subid 12 of etherStatsEntry.
771 * Its status is Current, and its access level is ReadOnly.
772 * OID: .1.3.6.1.2.1.16.1.1.1.12
773 * Description:
774 The total number of packets received that were
775 longer than 1518 octets (excluding framing bits,
776 but including FCS octets), and had either a bad
777 Frame Check Sequence (FCS) with an integral number
778 of octets (FCS Error) or a bad FCS with a non-integral
779 number of octets (Alignment Error).
780
781 Note that this definition of jabber is different
782 than the definition in IEEE-802.3 section 8.2.1.5
783 (10BASE5) and section 10.3.1.4 (10BASE2). These
784 documents define jabber as the condition where any
785 packet exceeds 20 ms. The allowed range to detect
786 jabber is between 20 ms and 150 ms.
787 *
788 * Attributes:
789 * accessible 1 isscalar 0 enums 0 hasdefval 0
790 * readable 1 iscolumn 1 ranges 0 hashint 0
791 * settable 0
792 *
793 *
794 * Its syntax is COUNTER (based on perltype COUNTER)
795 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
796 */
797 /**
798 * Extract the current value of the etherStatsJabbers data.
799 *
800 * Set a value using the data context for the row.
801 *
802 * @param rowreq_ctx
803 * Pointer to the row request context.
804 * @param etherStatsJabbers_val_ptr
805 * Pointer to storage for a u_long variable
806 *
807 * @retval MFD_SUCCESS : success
808 * @retval MFD_SKIP : skip this node (no value for now)
809 * @retval MFD_ERROR : Any other error
810 */
811 int
812 etherStatsJabbers_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
813 u_long * etherStatsJabbers_val_ptr)
814 {
815 /** we should have a non-NULL pointer */
816 netsnmp_assert(NULL != etherStatsJabbers_val_ptr);
817
818
819 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsJabbers_get",
820 "called\n"));
821
822 netsnmp_assert(NULL != rowreq_ctx);
823 /*
824 * TODO:231:o: |-> Extract the current value of the etherStatsJabbers data.
825 * copy (* etherStatsJabbers_val_ptr ) from rowreq_ctx->data
826 */
827 (*etherStatsJabbers_val_ptr) = rowreq_ctx->data.etherStatsJabbers;
828
829 return MFD_SUCCESS;
830 } /* etherStatsJabbers_get */
831
832 /*---------------------------------------------------------------------
833 * RMON-MIB::etherStatsEntry.etherStatsCollisions
834 * etherStatsCollisions is subid 13 of etherStatsEntry.
835 * Its status is Current, and its access level is ReadOnly.
836 * OID: .1.3.6.1.2.1.16.1.1.1.13
837 * Description:
838 The best estimate of the total number of collisions
839 on this Ethernet segment.
840
841 The value returned will depend on the location of the
842 RMON probe. Section 8.2.1.3 (10BASE-5) and section
843 10.3.1.3 (10BASE-2) of IEEE standard 802.3 states that a
844 station must detect a collision, in the receive mode, if
845 three or more stations are transmitting simultaneously. A
846 repeater port must detect a collision when two or more
847
848 stations are transmitting simultaneously. Thus a probe
849 placed on a repeater port could record more collisions
850 than a probe connected to a station on the same segment
851 would.
852
853 Probe location plays a much smaller role when considering
854 10BASE-T. 14.2.1.4 (10BASE-T) of IEEE standard 802.3
855 defines a collision as the simultaneous presence of signals
856 on the DO and RD circuits (transmitting and receiving
857 at the same time). A 10BASE-T station can only detect
858 collisions when it is transmitting. Thus probes placed on
859 a station and a repeater, should report the same number of
860 collisions.
861
862 Note also that an RMON probe inside a repeater should
863 ideally report collisions between the repeater and one or
864 more other hosts (transmit collisions as defined by IEEE
865 802.3k) plus receiver collisions observed on any coax
866 segments to which the repeater is connected.
867 *
868 * Attributes:
869 * accessible 1 isscalar 0 enums 0 hasdefval 0
870 * readable 1 iscolumn 1 ranges 0 hashint 0
871 * settable 0
872 *
873 *
874 * Its syntax is COUNTER (based on perltype COUNTER)
875 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
876 */
877 /**
878 * Extract the current value of the etherStatsCollisions data.
879 *
880 * Set a value using the data context for the row.
881 *
882 * @param rowreq_ctx
883 * Pointer to the row request context.
884 * @param etherStatsCollisions_val_ptr
885 * Pointer to storage for a u_long variable
886 *
887 * @retval MFD_SUCCESS : success
888 * @retval MFD_SKIP : skip this node (no value for now)
889 * @retval MFD_ERROR : Any other error
890 */
891 int
892 etherStatsCollisions_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
893 u_long * etherStatsCollisions_val_ptr)
894 {
895 /** we should have a non-NULL pointer */
896 netsnmp_assert(NULL != etherStatsCollisions_val_ptr);
897
898
899 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsCollisions_get",
900 "called\n"));
901
902 netsnmp_assert(NULL != rowreq_ctx);
903
904 /*
905 * TODO:231:o: |-> Extract the current value of the etherStatsCollisions data.
906 * copy (* etherStatsCollisions_val_ptr ) from rowreq_ctx->data
907 */
908 (*etherStatsCollisions_val_ptr) =
909 rowreq_ctx->data.etherStatsCollisions;
910
911 return MFD_SUCCESS;
912 } /* etherStatsCollisions_get */
913
914 /*---------------------------------------------------------------------
915 * RMON-MIB::etherStatsEntry.etherStatsPkts64Octets
916 * etherStatsPkts64Octets is subid 14 of etherStatsEntry.
917 * Its status is Current, and its access level is ReadOnly.
918 * OID: .1.3.6.1.2.1.16.1.1.1.14
919 * Description:
920 The total number of packets (including bad
921 packets) received that were 64 octets in length
922 (excluding framing bits but including FCS octets).
923 *
924 * Attributes:
925 * accessible 1 isscalar 0 enums 0 hasdefval 0
926 * readable 1 iscolumn 1 ranges 0 hashint 0
927 * settable 0
928 *
929 *
930 * Its syntax is COUNTER (based on perltype COUNTER)
931 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
932 */
933 /**
934 * Extract the current value of the etherStatsPkts64Octets data.
935 *
936 * Set a value using the data context for the row.
937 *
938 * @param rowreq_ctx
939 * Pointer to the row request context.
940 * @param etherStatsPkts64Octets_val_ptr
941 * Pointer to storage for a u_long variable
942 *
943 * @retval MFD_SUCCESS : success
944 * @retval MFD_SKIP : skip this node (no value for now)
945 * @retval MFD_ERROR : Any other error
946 */
947 int
948 etherStatsPkts64Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
949 u_long * etherStatsPkts64Octets_val_ptr)
950 {
951 /** we should have a non-NULL pointer */
952 netsnmp_assert(NULL != etherStatsPkts64Octets_val_ptr);
953
954
955 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts64Octets_get",
956 "called\n"));
957
958 netsnmp_assert(NULL != rowreq_ctx);
959
960 /*
961 * TODO:231:o: |-> Extract the current value of the etherStatsPkts64Octets data.
962 * copy (* etherStatsPkts64Octets_val_ptr ) from rowreq_ctx->data
963 */
964 (*etherStatsPkts64Octets_val_ptr) =
965 rowreq_ctx->data.etherStatsPkts64Octets;
966
967 return MFD_SUCCESS;
968 } /* etherStatsPkts64Octets_get */
969
970 /*---------------------------------------------------------------------
971 * RMON-MIB::etherStatsEntry.etherStatsPkts65to127Octets
972 * etherStatsPkts65to127Octets is subid 15 of etherStatsEntry.
973 * Its status is Current, and its access level is ReadOnly.
974 * OID: .1.3.6.1.2.1.16.1.1.1.15
975 * Description:
976 The total number of packets (including bad
977 packets) received that were between
978 65 and 127 octets in length inclusive
979 (excluding framing bits but including FCS octets).
980 *
981 * Attributes:
982 * accessible 1 isscalar 0 enums 0 hasdefval 0
983 * readable 1 iscolumn 1 ranges 0 hashint 0
984 * settable 0
985 *
986 *
987 * Its syntax is COUNTER (based on perltype COUNTER)
988 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
989 */
990 /**
991 * Extract the current value of the etherStatsPkts65to127Octets data.
992 *
993 * Set a value using the data context for the row.
994 *
995 * @param rowreq_ctx
996 * Pointer to the row request context.
997 * @param etherStatsPkts65to127Octets_val_ptr
998 * Pointer to storage for a u_long variable
999 *
1000 * @retval MFD_SUCCESS : success
1001 * @retval MFD_SKIP : skip this node (no value for now)
1002 * @retval MFD_ERROR : Any other error
1003 */
1004 int
1005 etherStatsPkts65to127Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
1006 u_long *
1007 etherStatsPkts65to127Octets_val_ptr)
1008 {
1009 /** we should have a non-NULL pointer */
1010 netsnmp_assert(NULL != etherStatsPkts65to127Octets_val_ptr);
1011
1012
1013 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts65to127Octets_get",
1014 "called\n"));
1015
1016 netsnmp_assert(NULL != rowreq_ctx);
1017
1018 /*
1019 * TODO:231:o: |-> Extract the current value of the etherStatsPkts65to127Octets data.
1020 * copy (* etherStatsPkts65to127Octets_val_ptr ) from rowreq_ctx->data
1021 */
1022 (*etherStatsPkts65to127Octets_val_ptr) =
1023 rowreq_ctx->data.etherStatsPkts65to127Octets;
1024
1025 return MFD_SUCCESS;
1026 } /* etherStatsPkts65to127Octets_get */
1027
1028 /*---------------------------------------------------------------------
1029 * RMON-MIB::etherStatsEntry.etherStatsPkts128to255Octets
1030 * etherStatsPkts128to255Octets is subid 16 of etherStatsEntry.
1031 * Its status is Current, and its access level is ReadOnly.
1032 * OID: .1.3.6.1.2.1.16.1.1.1.16
1033 * Description:
1034 The total number of packets (including bad
1035 packets) received that were between
1036 128 and 255 octets in length inclusive
1037 (excluding framing bits but including FCS octets).
1038 *
1039 * Attributes:
1040 * accessible 1 isscalar 0 enums 0 hasdefval 0
1041 * readable 1 iscolumn 1 ranges 0 hashint 0
1042 * settable 0
1043 *
1044 *
1045 * Its syntax is COUNTER (based on perltype COUNTER)
1046 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
1047 */
1048 /**
1049 * Extract the current value of the etherStatsPkts128to255Octets data.
1050 *
1051 * Set a value using the data context for the row.
1052 *
1053 * @param rowreq_ctx
1054 * Pointer to the row request context.
1055 * @param etherStatsPkts128to255Octets_val_ptr
1056 * Pointer to storage for a u_long variable
1057 *
1058 * @retval MFD_SUCCESS : success
1059 * @retval MFD_SKIP : skip this node (no value for now)
1060 * @retval MFD_ERROR : Any other error
1061 */
1062 int
1063 etherStatsPkts128to255Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
1064 u_long *
1065 etherStatsPkts128to255Octets_val_ptr)
1066 {
1067 /** we should have a non-NULL pointer */
1068 netsnmp_assert(NULL != etherStatsPkts128to255Octets_val_ptr);
1069
1070
1071 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts128to255Octets_get",
1072 "called\n"));
1073
1074 netsnmp_assert(NULL != rowreq_ctx);
1075
1076 /*
1077 * TODO:231:o: |-> Extract the current value of the etherStatsPkts128to255Octets data.
1078 * copy (* etherStatsPkts128to255Octets_val_ptr ) from rowreq_ctx->data
1079 */
1080 (*etherStatsPkts128to255Octets_val_ptr) =
1081 rowreq_ctx->data.etherStatsPkts128to255Octets;
1082
1083 return MFD_SUCCESS;
1084 } /* etherStatsPkts128to255Octets_get */
1085
1086 /*---------------------------------------------------------------------
1087 * RMON-MIB::etherStatsEntry.etherStatsPkts256to511Octets
1088 * etherStatsPkts256to511Octets is subid 17 of etherStatsEntry.
1089 * Its status is Current, and its access level is ReadOnly.
1090 * OID: .1.3.6.1.2.1.16.1.1.1.17
1091 * Description:
1092 The total number of packets (including bad
1093 packets) received that were between
1094 256 and 511 octets in length inclusive
1095 (excluding framing bits but including FCS octets).
1096 *
1097 * Attributes:
1098 * accessible 1 isscalar 0 enums 0 hasdefval 0
1099 * readable 1 iscolumn 1 ranges 0 hashint 0
1100 * settable 0
1101 *
1102 *
1103 * Its syntax is COUNTER (based on perltype COUNTER)
1104 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
1105 */
1106 /**
1107 * Extract the current value of the etherStatsPkts256to511Octets data.
1108 *
1109 * Set a value using the data context for the row.
1110 *
1111 * @param rowreq_ctx
1112 * Pointer to the row request context.
1113 * @param etherStatsPkts256to511Octets_val_ptr
1114 * Pointer to storage for a u_long variable
1115 *
1116 * @retval MFD_SUCCESS : success
1117 * @retval MFD_SKIP : skip this node (no value for now)
1118 * @retval MFD_ERROR : Any other error
1119 */
1120 int
1121 etherStatsPkts256to511Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
1122 u_long *
1123 etherStatsPkts256to511Octets_val_ptr)
1124 {
1125 /** we should have a non-NULL pointer */
1126 netsnmp_assert(NULL != etherStatsPkts256to511Octets_val_ptr);
1127
1128
1129 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts256to511Octets_get",
1130 "called\n"));
1131
1132 netsnmp_assert(NULL != rowreq_ctx);
1133
1134 /*
1135 * TODO:231:o: |-> Extract the current value of the etherStatsPkts256to511Octets data.
1136 * copy (* etherStatsPkts256to511Octets_val_ptr ) from rowreq_ctx->data
1137 */
1138 (*etherStatsPkts256to511Octets_val_ptr) =
1139 rowreq_ctx->data.etherStatsPkts256to511Octets;
1140
1141 return MFD_SUCCESS;
1142 } /* etherStatsPkts256to511Octets_get */
1143
1144 /*---------------------------------------------------------------------
1145 * RMON-MIB::etherStatsEntry.etherStatsPkts512to1023Octets
1146 * etherStatsPkts512to1023Octets is subid 18 of etherStatsEntry.
1147 * Its status is Current, and its access level is ReadOnly.
1148 * OID: .1.3.6.1.2.1.16.1.1.1.18
1149 * Description:
1150 The total number of packets (including bad
1151 packets) received that were between
1152 512 and 1023 octets in length inclusive
1153 (excluding framing bits but including FCS octets).
1154 *
1155 * Attributes:
1156 * accessible 1 isscalar 0 enums 0 hasdefval 0
1157 * readable 1 iscolumn 1 ranges 0 hashint 0
1158 * settable 0
1159 *
1160 *
1161 * Its syntax is COUNTER (based on perltype COUNTER)
1162 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
1163 */
1164 /**
1165 * Extract the current value of the etherStatsPkts512to1023Octets data.
1166 *
1167 * Set a value using the data context for the row.
1168 *
1169 * @param rowreq_ctx
1170 * Pointer to the row request context.
1171 * @param etherStatsPkts512to1023Octets_val_ptr
1172 * Pointer to storage for a u_long variable
1173 *
1174 * @retval MFD_SUCCESS : success
1175 * @retval MFD_SKIP : skip this node (no value for now)
1176 * @retval MFD_ERROR : Any other error
1177 */
1178 int
1179 etherStatsPkts512to1023Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
1180 u_long *
1181 etherStatsPkts512to1023Octets_val_ptr)
1182 {
1183 /** we should have a non-NULL pointer */
1184 netsnmp_assert(NULL != etherStatsPkts512to1023Octets_val_ptr);
1185
1186
1187 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts512to1023Octets_get", "called\n"));
1188
1189 netsnmp_assert(NULL != rowreq_ctx);
1190
1191 /*
1192 * TODO:231:o: |-> Extract the current value of the etherStatsPkts512to1023Octets data.
1193 * copy (* etherStatsPkts512to1023Octets_val_ptr ) from rowreq_ctx->data
1194 */
1195 (*etherStatsPkts512to1023Octets_val_ptr) =
1196 rowreq_ctx->data.etherStatsPkts512to1023Octets;
1197
1198 return MFD_SUCCESS;
1199 } /* etherStatsPkts512to1023Octets_get */
1200
1201 /*---------------------------------------------------------------------
1202 * RMON-MIB::etherStatsEntry.etherStatsPkts1024to1518Octets
1203 * etherStatsPkts1024to1518Octets is subid 19 of etherStatsEntry.
1204 * Its status is Current, and its access level is ReadOnly.
1205 * OID: .1.3.6.1.2.1.16.1.1.1.19
1206 * Description:
1207 The total number of packets (including bad
1208 packets) received that were between
1209 1024 and 1518 octets in length inclusive
1210 (excluding framing bits but including FCS octets).
1211 *
1212 * Attributes:
1213 * accessible 1 isscalar 0 enums 0 hasdefval 0
1214 * readable 1 iscolumn 1 ranges 0 hashint 0
1215 * settable 0
1216 *
1217 *
1218 * Its syntax is COUNTER (based on perltype COUNTER)
1219 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
1220 */
1221 /**
1222 * Extract the current value of the etherStatsPkts1024to1518Octets data.
1223 *
1224 * Set a value using the data context for the row.
1225 *
1226 * @param rowreq_ctx
1227 * Pointer to the row request context.
1228 * @param etherStatsPkts1024to1518Octets_val_ptr
1229 * Pointer to storage for a u_long variable
1230 *
1231 * @retval MFD_SUCCESS : success
1232 * @retval MFD_SKIP : skip this node (no value for now)
1233 * @retval MFD_ERROR : Any other error
1234 */
1235 int
1236 etherStatsPkts1024to1518Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
1237 u_long *
1238 etherStatsPkts1024to1518Octets_val_ptr)
1239 {
1240 /** we should have a non-NULL pointer */
1241 netsnmp_assert(NULL != etherStatsPkts1024to1518Octets_val_ptr);
1242
1243
1244 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts1024to1518Octets_get", "called\n"));
1245
1246 netsnmp_assert(NULL != rowreq_ctx);
1247
1248 /*
1249 * TODO:231:o: |-> Extract the current value of the etherStatsPkts1024to1518Octets data.
1250 * copy (* etherStatsPkts1024to1518Octets_val_ptr ) from rowreq_ctx->data
1251 */
1252 (*etherStatsPkts1024to1518Octets_val_ptr) =
1253 rowreq_ctx->data.etherStatsPkts1024to1518Octets;
1254
1255 return MFD_SUCCESS;
1256 } /* etherStatsPkts1024to1518Octets_get */
1257
1258 /*---------------------------------------------------------------------
1259 * RMON-MIB::etherStatsEntry.etherStatsOwner
1260 * etherStatsOwner is subid 20 of etherStatsEntry.
1261 * Its status is Current, and its access level is Create.
1262 * OID: .1.3.6.1.2.1.16.1.1.1.20
1263 * Description:
1264 The entity that configured this entry and is therefore
1265 using the resources assigned to it.
1266 *
1267 * Attributes:
1268 * accessible 1 isscalar 0 enums 0 hasdefval 0
1269 * readable 1 iscolumn 1 ranges 1 hashint 0
1270 * settable 1
1271 *
1272 * Ranges: 0 - 127;
1273 *
1274 * Its syntax is OwnerString (based on perltype OCTETSTR)
1275 * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
1276 * This data type requires a length. (Max 127)
1277 */
1278 /**
1279 * Extract the current value of the etherStatsOwner data.
1280 *
1281 * Set a value using the data context for the row.
1282 *
1283 * @param rowreq_ctx
1284 * Pointer to the row request context.
1285 * @param etherStatsOwner_val_ptr_ptr
1286 * Pointer to storage for a char variable
1287 * @param etherStatsOwner_val_ptr_len_ptr
1288 * Pointer to a size_t. On entry, it will contain the size (in bytes)
1289 * pointed to by etherStatsOwner.
1290 * On exit, this value should contain the data size (in bytes).
1291 *
1292 * @retval MFD_SUCCESS : success
1293 * @retval MFD_SKIP : skip this node (no value for now)
1294 * @retval MFD_ERROR : Any other error
1295 *
1296 * @note If you need more than (*etherStatsOwner_val_ptr_len_ptr) bytes of memory,
1297 * allocate it using malloc() and update etherStatsOwner_val_ptr_ptr.
1298 * <b>DO NOT</b> free the previous pointer.
1299 * The MFD helper will release the memory you allocate.
1300 *
1301 * @remark If you call this function yourself, you are responsible
1302 * for checking if the pointer changed, and freeing any
1303 * previously allocated memory. (Not necessary if you pass
1304 * in a pointer to static memory, obviously.)
1305 */
1306 int
1307 etherStatsOwner_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
1308 char **etherStatsOwner_val_ptr_ptr,
1309 size_t *etherStatsOwner_val_ptr_len_ptr)
1310 {
1311 /** we should have a non-NULL pointer and enough storage */
1312 netsnmp_assert((NULL != etherStatsOwner_val_ptr_ptr)
1313 && (NULL != *etherStatsOwner_val_ptr_ptr));
1314 netsnmp_assert(NULL != etherStatsOwner_val_ptr_len_ptr);
1315
1316
1317 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_get",
1318 "called\n"));
1319
1320 netsnmp_assert(NULL != rowreq_ctx);
1321
1322 /*
1323 * TODO:231:o: |-> Extract the current value of the etherStatsOwner data.
1324 * copy (* etherStatsOwner_val_ptr_ptr ) data and (* etherStatsOwner_val_ptr_len_ptr ) from rowreq_ctx->data
1325 */
1326 /*
1327 * make sure there is enough space for etherStatsOwner data
1328 */
1329 if ((NULL == (*etherStatsOwner_val_ptr_ptr)) ||
1330 ((*etherStatsOwner_val_ptr_len_ptr) <
1331 (rowreq_ctx->data.etherStatsOwner_len *
1332 sizeof(rowreq_ctx->data.etherStatsOwner[0])))) {
1333 /*
1334 * allocate space for etherStatsOwner data
1335 */
1336 (*etherStatsOwner_val_ptr_ptr) =
1337 malloc(rowreq_ctx->data.etherStatsOwner_len *
1338 sizeof(rowreq_ctx->data.etherStatsOwner[0]));
1339 if (NULL == (*etherStatsOwner_val_ptr_ptr)) {
1340 snmp_log(LOG_ERR, "could not allocate memory\n");
1341 return MFD_ERROR;
1342 }
1343 }
1344 (*etherStatsOwner_val_ptr_len_ptr) =
1345 rowreq_ctx->data.etherStatsOwner_len *
1346 sizeof(rowreq_ctx->data.etherStatsOwner[0]);
1347 memcpy((*etherStatsOwner_val_ptr_ptr),
1348 rowreq_ctx->data.etherStatsOwner,
1349 rowreq_ctx->data.etherStatsOwner_len *
1350 sizeof(rowreq_ctx->data.etherStatsOwner[0]));
1351
1352 return MFD_SUCCESS;
1353 } /* etherStatsOwner_get */
1354
1355 /*---------------------------------------------------------------------
1356 * RMON-MIB::etherStatsEntry.etherStatsStatus
1357 * etherStatsStatus is subid 21 of etherStatsEntry.
1358 * Its status is Current, and its access level is Create.
1359 * OID: .1.3.6.1.2.1.16.1.1.1.21
1360 * Description:
1361 The status of this etherStats entry.
1362 *
1363 * Attributes:
1364 * accessible 1 isscalar 0 enums 1 hasdefval 0
1365 * readable 1 iscolumn 1 ranges 0 hashint 0
1366 * settable 1
1367 *
1368 * Enum range: 2/8. Values: valid(1), createRequest(2), underCreation(3), invalid(4)
1369 *
1370 * Its syntax is EntryStatus (based on perltype INTEGER)
1371 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
1372 */
1373 /**
1374 * Extract the current value of the etherStatsStatus data.
1375 *
1376 * Set a value using the data context for the row.
1377 *
1378 * @param rowreq_ctx
1379 * Pointer to the row request context.
1380 * @param etherStatsStatus_val_ptr
1381 * Pointer to storage for a long variable
1382 *
1383 * @retval MFD_SUCCESS : success
1384 * @retval MFD_SKIP : skip this node (no value for now)
1385 * @retval MFD_ERROR : Any other error
1386 */
1387 int
1388 etherStatsStatus_get(etherStatsTable_rowreq_ctx * rowreq_ctx,
1389 u_long * etherStatsStatus_val_ptr)
1390 {
1391 /** we should have a non-NULL pointer */
1392 netsnmp_assert(NULL != etherStatsStatus_val_ptr);
1393
1394
1395 DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_get",
1396 "called\n"));
1397
1398 netsnmp_assert(NULL != rowreq_ctx);
1399
1400 /*
1401 * TODO:231:o: |-> Extract the current value of the etherStatsStatus data.
1402 * copy (* etherStatsStatus_val_ptr ) from rowreq_ctx->data
1403 */
1404 (*etherStatsStatus_val_ptr) = rowreq_ctx->data.etherStatsStatus;
1405
1406 return MFD_SUCCESS;
1407 } /* etherStatsStatus_get */
1408
1409
1410
1411 /** @} */