~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-13 12:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040913120621-g952ntonlleihcvm
Tags: upstream-5.1.1
ImportĀ upstreamĀ versionĀ 5.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
14
/** Decides if an incoming value for the netSnmpHostAddressType mib node is legal, from a local implementation specific viewpoint.
 
15
 *  @param type    The incoming data type.
 
16
 *  @param val     The value to be checked.
 
17
 *  @param val_len The length of data stored in val (in bytes).
 
18
 *  @return 0 if the incoming value is legal, an SNMP error code otherwise.
 
19
 */
 
20
int
 
21
check_netSnmpHostAddressType_local(int type, long *val, size_t val_len,
 
22
                                   long *old_val, size_t old_val_len)
 
23
{
 
24
 
 
25
    /** XXX: you may want to check aspects of the new value that
 
26
       were not covered by the automatic checks by the parent function. */
 
27
 
 
28
    /** XXX: you make want to check that the requested change from
 
29
        the old value to the new value is legal (ie, the transistion
 
30
        from one value to another is legal */
 
31
 
 
32
    if (*val != NETSNMPHOSTADDRESSTYPE_IPV4)
 
33
        return SNMP_ERR_WRONGVALUE;
 
34
 
 
35
    /** if everything looks ok, return SNMP_ERR_NOERROR */
 
36
    return SNMP_ERR_NOERROR;
 
37
}
 
38
 
 
39
/** Decides if an incoming value for the netSnmpHostAddress mib node is legal, from a local implementation specific viewpoint.
 
40
 *  @param type    The incoming data type.
 
41
 *  @param val     The value to be checked.
 
42
 *  @param val_len The length of data stored in val (in bytes).
 
43
 *  @return 0 if the incoming value is legal, an SNMP error code otherwise.
 
44
 */
 
45
int
 
46
check_netSnmpHostAddress_local(int type, char *val, size_t val_len,
 
47
                               char *old_val, size_t old_val_len)
 
48
{
 
49
 
 
50
    /** XXX: you may want to check aspects of the new value that
 
51
       were not covered by the automatic checks by the parent function. */
 
52
 
 
53
    /** XXX: you make want to check that the requested change from
 
54
        the old value to the new value is legal (ie, the transistion
 
55
        from one value to another is legal */
 
56
 
 
57
    if (val_len != 4)
 
58
        return SNMP_ERR_WRONGVALUE;
 
59
 
 
60
    /** if everything looks ok, return SNMP_ERR_NOERROR */
 
61
    return SNMP_ERR_NOERROR;
 
62
}
 
63
 
 
64
/** Decides if an incoming value for the netSnmpHostStorage mib node is legal, from a local implementation specific viewpoint.
 
65
 *  @param type    The incoming data type.
 
66
 *  @param val     The value to be checked.
 
67
 *  @param val_len The length of data stored in val (in bytes).
 
68
 *  @return 0 if the incoming value is legal, an SNMP error code otherwise.
 
69
 */
 
70
int
 
71
check_netSnmpHostStorage_local(int type, long *val, size_t val_len,
 
72
                               long *old_val, size_t old_val_len)
 
73
{
 
74
 
 
75
    /** XXX: you may want to check aspects of the new value that
 
76
       were not covered by the automatic checks by the parent function. */
 
77
 
 
78
    /** XXX: you make want to check that the requested change from
 
79
        the old value to the new value is legal (ie, the transistion
 
80
        from one value to another is legal */
 
81
 
 
82
    if (*val != ST_NONVOLATILE)
 
83
        return SNMP_ERR_WRONGVALUE;
 
84
 
 
85
    /** if everything looks ok, return SNMP_ERR_NOERROR */
 
86
    return SNMP_ERR_NOERROR;
 
87
}
 
88
 
 
89
/** Decides if an incoming value for the netSnmpHostRowStatus mib node is legal, from a local implementation specific viewpoint.
 
90
 *  @param type    The incoming data type.
 
91
 *  @param val     The value to be checked.
 
92
 *  @param val_len The length of data stored in val (in bytes).
 
93
 *  @return 0 if the incoming value is legal, an SNMP error code otherwise.
 
94
 */
 
95
int
 
96
check_netSnmpHostRowStatus_local(int type, long *val, size_t val_len,
 
97
                                 long *old_val, size_t old_val_len)
 
98
{
 
99
 
 
100
    /** XXX: you may want to check aspects of the new value that
 
101
       were not covered by the automatic checks by the parent function. */
 
102
 
 
103
    /** XXX: you make want to check that the requested change from
 
104
        the old value to the new value is legal (ie, the transistion
 
105
        from one value to another is legal */
 
106
 
 
107
    /** if everything looks ok, return SNMP_ERR_NOERROR */
 
108
    return SNMP_ERR_NOERROR;
 
109
}