Debian Codegraph @

agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c

raw
1 /*
2 * Note: this file originally auto-generated by mib2c using
3 * : mib2c.check_values_local.conf,v 5.1 2003/05/30 23:53:15 hardaker Exp $
4 */
5
6 /*
7 * standard headers
8 */
9 #include <net-snmp/net-snmp-config.h>
10 #include <net-snmp/net-snmp-includes.h>
11 #include "netSnmpHostsTable_checkfns.h"
12 #include "netSnmpHostsTable_enums.h"
13 #include "netSnmpHostsTable_checkfns_local.h"
14
15 /** Decides if an incoming value for the netSnmpHostAddressType mib node is legal, from a local implementation specific viewpoint.
16 * @param type The incoming data type.
17 * @param val The value to be checked.
18 * @param val_len The length of data stored in val (in bytes).
19 * @param old_val
20 * @param old_val_len
21 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
22 */
23 int
24 check_netSnmpHostAddressType_local(int type, long *val, size_t val_len,
25 long *old_val, size_t old_val_len)
26 {
27
28 /** XXX: you may want to check aspects of the new value that
29 were not covered by the automatic checks by the parent function. */
30
31 /** XXX: you make want to check that the requested change from
32 the old value to the new value is legal (ie, the transistion
33 from one value to another is legal */
34
35 if (*val != NETSNMPHOSTADDRESSTYPE_IPV4)
36 return SNMP_ERR_WRONGVALUE;
37
38 /** if everything looks ok, return SNMP_ERR_NOERROR */
39 return SNMP_ERR_NOERROR;
40 }
41
42 /** Decides if an incoming value for the netSnmpHostAddress mib node is legal, from a local implementation specific viewpoint.
43 * @param type The incoming data type.
44 * @param val The value to be checked.
45 * @param val_len The length of data stored in val (in bytes).
46 * @param old_val
47 * @param old_val_len
48 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
49 */
50 int
51 check_netSnmpHostAddress_local(int type, char *val, size_t val_len,
52 char *old_val, size_t old_val_len)
53 {
54
55 /** XXX: you may want to check aspects of the new value that
56 were not covered by the automatic checks by the parent function. */
57
58 /** XXX: you make want to check that the requested change from
59 the old value to the new value is legal (ie, the transistion
60 from one value to another is legal */
61
62 if (val_len != 4)
63 return SNMP_ERR_WRONGVALUE;
64
65 /** if everything looks ok, return SNMP_ERR_NOERROR */
66 return SNMP_ERR_NOERROR;
67 }
68
69 /** Decides if an incoming value for the netSnmpHostStorage mib node is legal, from a local implementation specific viewpoint.
70 * @param type The incoming data type.
71 * @param val The value to be checked.
72 * @param val_len The length of data stored in val (in bytes).
73 * @param old_val
74 * @param old_val_len
75 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
76 */
77 int
78 check_netSnmpHostStorage_local(int type, long *val, size_t val_len,
79 long *old_val, size_t old_val_len)
80 {
81
82 /** XXX: you may want to check aspects of the new value that
83 were not covered by the automatic checks by the parent function. */
84
85 /** XXX: you make want to check that the requested change from
86 the old value to the new value is legal (ie, the transistion
87 from one value to another is legal */
88
89 if (*val != ST_NONVOLATILE)
90 return SNMP_ERR_WRONGVALUE;
91
92 /** if everything looks ok, return SNMP_ERR_NOERROR */
93 return SNMP_ERR_NOERROR;
94 }
95
96 /** Decides if an incoming value for the netSnmpHostRowStatus mib node is legal, from a local implementation specific viewpoint.
97 * @param type The incoming data type.
98 * @param val The value to be checked.
99 * @param val_len The length of data stored in val (in bytes).
100 * @param old_val
101 * @param old_val_len
102 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
103 */
104 int
105 check_netSnmpHostRowStatus_local(int type, long *val, size_t val_len,
106 long *old_val, size_t old_val_len)
107 {
108
109 /** XXX: you may want to check aspects of the new value that
110 were not covered by the automatic checks by the parent function. */
111
112 /** XXX: you make want to check that the requested change from
113 the old value to the new value is legal (ie, the transistion
114 from one value to another is legal */
115
116 /** if everything looks ok, return SNMP_ERR_NOERROR */
117 return SNMP_ERR_NOERROR;
118 }