Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

snmp_agent_misc.c File Reference

snmp_agent_misc.c File Reference

SNMP agent (miscellaneous functions) More...

Go to the source code of this file.

Functions

void snmpLockMib (SnmpAgentContext *context)
 Lock MIB bases.
void snmpUnlockMib (SnmpAgentContext *context)
 Unlock MIB bases.
error_t snmpInitResponse (SnmpAgentContext *context)
 Initialize a GetResponse-PDU.
void snmpRefreshEngineTime (SnmpAgentContext *context)
 Refresh SNMP engine time.
error_t snmpCheckEngineTime (SnmpAgentContext *context, SnmpMessage *message)
 Replay protection.
SnmpUserInfosnmpFindUser (SnmpAgentContext *context, const char_t *name, size_t length)
 Find user in the local configuration datastore.
error_t snmpParseVarBinding (const uint8_t *p, size_t length, SnmpVarBind *var, size_t *consumed)
 Parse variable binding.
error_t snmpWriteVarBinding (SnmpAgentContext *context, const SnmpVarBind *var)
 Write variable binding.
error_t snmpCopyVarBindingList (SnmpAgentContext *context)
 Copy the list of variable bindings.
error_t snmpSetObjectValue (SnmpAgentContext *context, SnmpVarBind *var, bool_t commit)
 Assign object value.
error_t snmpGetObjectValue (SnmpAgentContext *context, SnmpVarBind *var)
 Retrieve object value.
error_t snmpGetNextObject (SnmpAgentContext *context, SnmpVarBind *var)
 Search MIBs for the next object.
error_t snmpFindMibObject (SnmpAgentContext *context, const uint8_t *oid, size_t oidLen, const MibObject **object)
 Search MIBs for the given object.
error_t snmpTranslateStatusCode (SnmpMessage *message, error_t status, uint_t index)
 Translate status code.

Detailed Description

SNMP agent (miscellaneous functions)

License

Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author:
Oryx Embedded SARL (www.oryx-embedded.com)
Version:
1.7.6

Definition in file snmp_agent_misc.c.


Function Documentation

error_t snmpCheckEngineTime ( SnmpAgentContext context,
SnmpMessage message 
)

Replay protection.

Parameters:
[in]contextPointer to the SNMP agent context
[in,out]messagePointer to the incoming SNMP message
Returns:
Error code

Definition at line 208 of file snmp_agent_misc.c.

error_t snmpCopyVarBindingList ( SnmpAgentContext context )

Copy the list of variable bindings.

Parameters:
[in]contextPointer to the SNMP agent context
Returns:
Error code

Definition at line 485 of file snmp_agent_misc.c.

error_t snmpFindMibObject ( SnmpAgentContext context,
const uint8_t *  oid,
size_t  oidLen,
const MibObject **  object 
)

Search MIBs for the given object.

Parameters:
[in]contextPointer to the SNMP agent context
[in]oidObject identifier
[in]oidLenLength of the OID
[out]objectPointer the MIB object descriptor
Returns:
Error code

Definition at line 932 of file snmp_agent_misc.c.

SnmpUserInfo* snmpFindUser ( SnmpAgentContext context,
const char_t *  name,
size_t  length 
)

Find user in the local configuration datastore.

Parameters:
[in]contextPointer to the SNMP agent context
[in]namePointer to the user name
[in]lengthLength of the user name
Returns:
Security profile corresponding to the specified user name

Definition at line 249 of file snmp_agent_misc.c.

error_t snmpGetNextObject ( SnmpAgentContext context,
SnmpVarBind var 
)

Search MIBs for the next object.

Parameters:
[in]contextPointer to the SNMP agent context
[in]varVariable binding
Returns:
Error pointer

Definition at line 826 of file snmp_agent_misc.c.

error_t snmpGetObjectValue ( SnmpAgentContext context,
SnmpVarBind var 
)

Retrieve object value.

Parameters:
[in]contextPointer to the SNMP agent context
[out]varVariable binding
Returns:
Error code

Definition at line 676 of file snmp_agent_misc.c.

error_t snmpInitResponse ( SnmpAgentContext context )

Initialize a GetResponse-PDU.

Parameters:
[in]contextPointer to the SNMP agent context
Returns:
Error code

Definition at line 93 of file snmp_agent_misc.c.

void snmpLockMib ( SnmpAgentContext context )

Lock MIB bases.

Definition at line 51 of file snmp_agent_misc.c.

error_t snmpParseVarBinding ( const uint8_t *  p,
size_t  length,
SnmpVarBind var,
size_t *  consumed 
)

Parse variable binding.

Parameters:
[in]pInput stream where to read the variable binding
[in]lengthNumber of bytes available in the input stream
[out]varVariable binding
[out]consumedTotal number of bytes that have been consumed
Returns:
Error code

Definition at line 292 of file snmp_agent_misc.c.

void snmpRefreshEngineTime ( SnmpAgentContext context )

Refresh SNMP engine time.

Parameters:
[in]contextPointer to the SNMP agent context

Definition at line 169 of file snmp_agent_misc.c.

error_t snmpSetObjectValue ( SnmpAgentContext context,
SnmpVarBind var,
bool_t  commit 
)

Assign object value.

Parameters:
[in]contextPointer to the SNMP agent context
[in]varVariable binding
[in]commitThis flag tells whether the changes should be committed to the MIB base
Returns:
Error code

Definition at line 512 of file snmp_agent_misc.c.

error_t snmpTranslateStatusCode ( SnmpMessage message,
error_t  status,
uint_t  index 
)

Translate status code.

Parameters:
[in,out]messagePointer to the outgoing SNMP message
[in]statusStatus code
[in]indexIndex of the variable binding in the list that caused an exception
Returns:
error code

Definition at line 1007 of file snmp_agent_misc.c.

void snmpUnlockMib ( SnmpAgentContext context )

Unlock MIB bases.

Definition at line 71 of file snmp_agent_misc.c.

error_t snmpWriteVarBinding ( SnmpAgentContext context,
const SnmpVarBind var 
)

Write variable binding.

Parameters:
[in]contextPointer to the SNMP agent context
[in]varVariable binding
Returns:
Error code

Definition at line 367 of file snmp_agent_misc.c.