SNMP Subagent Programmer's Guide

Programming Tutorials
SNMP Subagent Programmer’s Guide—119728 2-95
Security Checker
static int
#ifdef USE_PROTOTYPES
SET_helloPrintFreq(void *ctxt, void **indices, void *attr_ref)
#else
SET_helloPrintFreq(ctxt, indices, attr_ref)
void *ctxt;
void **indices;
void *attr_ref;
#endif
{
INTEGER *attr;
if (!authenticated) {return(SNMP_ERR_GEN_ERR);} <-
-19
attr = (INTEGER *) attr_ref;
helloPrintFreq = *attr;
return(SNMP_ERR_NO_ERROR);
}
static int
#ifdef USE_PROTOTYPES
GET_helloPrintCnt(void *ctxt, void **indices, void *attr_ref)
#else
GET_helloPrintCnt(ctxt, indices, attr_ref)
void *ctxt;
void **indices;
void *attr_ref;
#endif
{
Counter *attr;
if (!authenticated) {return(SNMP_ERR_GEN_ERR);} <-
-19
attr = (Counter *) attr_ref;
*attr = helloPrintCnt;
return(SNMP_ERR_NO_ERROR);
}
Example 2-20. Security Checker Access Functions (page 3 of 3)