snmp_stub.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1999-2002 Sun Microsystems, Inc.
* All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* file: snmp_stub.c
*
* This file contains the SNMP routines used to retrieve
* the Mobility Agent's various counter and configurable
* information.
*/
#include <impl.h>
#include <snmp.h>
#include "agent.h"
/* Counters common to all Mobility Agents */
extern CommonCounters commonCounters;
/* Counters maintained by Foreign Agents */
extern ForeignAgentCounters faCounters;
/* Counters maintained by Home Agents */
extern HomeAgentCounters haCounters;
#define MIP_MOBILE_NODE 0x1
#define MIP_FOREIGN_AGENT 0x2
#define MIP_HOME_AGENT 0x4
#define MIP_ENABLE 1
#define MIP_DISABLE 2
#define MIP_ENCAP_IP_IN_IP 0x1
#define MIP_ENCAP_GRE 0x2
#define MIP_ENCAP_MIN_ENCAP 0x4
#define MIP_OTHER 0x8
/*
* Function: get_mipEntities
*
* Arguments: mipEntities - Pointer to Integer
*
* Description: Returns whether the agent is running
*
* Returns: int, 0 if successful
*/
int
{
/*
* We can only be both Mobility Agents
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_mipEnable
*
* Arguments: mipEnable - Pointer to Integer
*
* Description: This function is called to determine if
* if the Mobile-IP Agent is in the
* active mode.
*
* Returns: int, 0 if successful
*/
int
{
/*
* If we get this far, then we are enabled :)
*/
*mipEnable = MIP_ENABLE;
return (SNMP_ERR_NOERROR);
}
/*
* Function: set_mipEnable
*
* Arguments: pass - The SNMP Pass
* mipEnable - Pointer to an Integer
*
* Description: This function is called to start the
* SNMP Mobile-IP Agent. We do not currently
* support this option.
*
* Returns: int, 0 if successful
*/
int
{
switch (pass) {
case FIRST_PASS:
/*
* Check whether the argument provided was valid to begin with
*/
return (SNMP_ERR_GENERR);
}
return (SNMP_ERR_NOERROR);
case SECOND_PASS:
/*
* Here is where we allow the value to be changed. We do
* not allow this at this time.
*/
return (SNMP_ERR_READONLY);
}
return (SNMP_ERR_GENERR);
}
/*
* Function: get_mipEncapsulationSupported
*
* Arguments: mipEncapsulationSupported - Pointer to Integer
*
* Description: This function is called to retrieve the
* encapsulation types supported by the
* agent.
*
* Returns: int, 0 if successful
*/
int
{
/*
* We currently only support IP in IP
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_mipSecTotalViolations
*
* Arguments: mipSecTotalViolations - Pointer to Integer
*
* Description: This function is called to retrieve the
* number of security violations since start-up.
*
* Returns: int, 0 if successful
*/
int
{
/*
* TODO: Return the total number of un-authenticated requests
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_maAdvertisementsSent
*
* Arguments: maAdvertisementsSent - Pointer to Integer
*
* Description: This function is called to retrieve the
* number of advertisements transmitted.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of advertisements sent
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_maAdvsSentForSolicitation
*
* Arguments: maAdvsSentForSolicitation - Pointer to Integer
*
* Description: This function is called to retrieve the
* number of advertisements transmitted as a
* result of a solicitation received.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of advertisements we've sent
* due to a solicitation.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_maSolicitationsReceived
*
* Arguments: maSolicitationsReceived - Pointer to Integer
*
* Description: This function is called to retrieve the
* number of solicitations received.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of solicitations received.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faIsBusy
*
* Arguments: faIsBusy - Pointer to Integer
*
* Description: This function is called to retrieve the
* number of times we've advertised the fact
* that we were busy.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of times that the foreign agent has
* responded as being too busy.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faRegistrationRequired
*
* Arguments: faRegistrationRequired - Pointer to Integer
*
* Description: This function is called to determine whether
* we require registrations to provide service.
*
* Returns: int, 0 if successful
*/
int
{
/*
* States whether the Foreign Agent REQUIRES that
* all Mobile Nodes register with it. We currently
* have no way of enforcing this (short of setting
* up a filter on the Foreign Agent).
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: set_faRegistrationRequired
*
* Arguments: pass - The SNMP Pass
* faRegistrationRequired - Pointer to an Integer
*
* Description: This function is called to require the agent
* to receive a registration in order to provide
* service. We do not currently allow this to
* be set via SNMP.
*
* Returns: int, 0 if successful
*/
int
{
switch (pass) {
case FIRST_PASS:
/*
* Check whether a valid argument was passed.
*/
if (*faRegistrationRequired == _B_TRUE ||
*faRegistrationRequired == _B_FALSE) {
return (SNMP_ERR_NOERROR);
}
return (SNMP_ERR_GENERR);
case SECOND_PASS:
/*
* Sorry, we do not allow this at this time.
*/
return (SNMP_ERR_READONLY);
}
return (SNMP_ERR_GENERR);
}
/*
* Function: get_faRegRequestsReceived
*
* Arguments: faRegRequestsReceived - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've received.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Registration Requests we've
* received.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faRegRequestsRelayed
*
* Arguments: faRegRequestsRelayed - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* relayed to a Home Agent.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Registration Requests we've
* replayed.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faReasonUnspecified
*
* Arguments: faReasonUnspecified - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to reason
* unspecified.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Registration Requests we've
* rejected for unspecified reasons (error 64).
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faAdmProhibited
*
* Arguments: faAdmProhibited - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to administratively
* prohibited.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Registration Requests we've
* rejected for administrative purposes (error 65).
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faInsufficientResource
*
* Arguments: faInsufficientResource - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to insufficient
* resources.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Registration Requests we've
* rejected due to insufficient resources (error 66).
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faMNAuthenticationFailure
*
* Arguments: faMNAuthenticationFailure - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to MN-FA
* Authentication Failure.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Mobile Node authentication
* failures.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faRegLifetimeTooLong
*
* Arguments: faRegLifetimeTooLong - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to lifetime
* too long.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of failed Registration Requests
* due to a lifetime too long.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faPoorlyFormedRequests
*
* Arguments: faPoorlyFormedRequests - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to poorly
* formed request.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Returns the number of poorly formed requests we've
* received.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faEncapsulationUnavailable
*
* Arguments: faEncapsulationUnavailable - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to encapsulation
* unavailable.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Returns the number of times we've rejected a request
* due to an unsupported encapsulation.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faVJCompressionUnavailable
*
* Arguments: faVJCompressionUnavailable - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to VJ compression
* unavailable.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Returns the number of times we've returned an error
* stating that compression was unavailable.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faHAUnreachable
*
* Arguments: faHAUnreachable - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* failed with the error set to HA
* unreachable.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Returns the number of times that we've replied to a
* mobile node stating that the home agent was unreachable.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faRegRepliesRecieved
*
* Arguments: faRegRepliesRecieved - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've
* received.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Returns the number of Registration Replies we've received.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faRegRepliesRelayed
*
* Arguments: faRegRepliesRelayed - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've
* relayed.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Returns the number of Registration Replies we've relayed.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faHAAuthenticationFailure
*
* Arguments: faHAAuthenticationFailure - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've
* relayed with the error FA-HA Auth Failure.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Returns the number of times that we've encountered an
* FA-HA Authentication failure.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_faPoorlyFormedReplies
*
* Arguments: faPoorlyFormedReplies - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've
* relayed with the error poorly formed reply.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of times that we've received a poorly
* formed reply.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haRegistrationAccepted
*
* Arguments: haRegistrationAccepted - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Requests we've
* accepted.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've accepted.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haMultiBindingUnsupported
*
* Arguments: haMultiBindingUnsupported - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to multiple bindings
* unsupported.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Ret urn the number of Registrations that we've denied with
* code 1.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haReasonUnspecified
*
* Arguments: haReasonUnspecified - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to reason unspecified.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 128.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haAdmProhibited
*
* Arguments: haAdmProhibited - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to administratively
* prohibited.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 129.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haInsufficientResource
*
* Arguments: haInsufficientResource - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to insufficient
* resources.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 130.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haMNAuthenticationFailure
*
* Arguments: haMNAuthenticationFailure - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to MN-HA Authentication
* failed.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 131.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haFAAuthenticationFailure
*
* Arguments: haFAAuthenticationFailure - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to FA-HA Authentication
* failed.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 132.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haIDMismatch
*
* Arguments: haIDMismatch - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to ID Mismatch.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 133.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haPoorlyFormedRequest
*
* Arguments: haPoorlyFormedRequest - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to poorly formed
* request.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 134.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haTooManyBindings
*
* Arguments: haTooManyBindings - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to too many bindings.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 135.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haUnknownHA
*
* Arguments: haUnknownHA - Pointer to Integer
*
* Description: This function is called to return the
* number of Registration Replies we've sent
* with the error set to unknown Home Agent.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the number of Registrations that we've denied with
* code 136.
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haGratuitiousARPsSent
*
* Arguments: haGratuitiousARPsSent - Pointer to Integer
*
* Description: This function is called to return the
* number of gratuitious ARPs sent.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of gratuitious ARPs sent
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haProxyARPsSent
*
* Arguments: haProxyARPsSent - Pointer to Integer
*
* Description: This function is called to return the
* number of proxy ARPs sent.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of proxy ARPs sent
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haRegRequestsReceived
*
* Arguments: haRegRequestsReceived - Pointer to Integer
*
* Description: This function is called to return the
* number of registration requests received.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Registration Requests received
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haDeRegRequestsReceived
*
* Arguments: haDeRegRequestsReceived - Pointer to Integer
*
* Description: This function is called to return the
* number of deregistration requests received.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Deregistration Requests received
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haRegRepliesSent
*
* Arguments: haRegRepliesSent - Pointer to Integer
*
* Description: This function is called to return the
* number of registration replies sent.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Registration Replies we've
* sent
*/
return (SNMP_ERR_NOERROR);
}
/*
* Function: get_haDeRegRepliesSent
*
* Arguments: haDeRegRepliesSent - Pointer to Integer
*
* Description: This function is called to return the
* number of deregistration replies sent.
*
* Returns: int, 0 if successful
*/
int
{
/*
* Return the total number of Registration Replies we've
* received
*/
return (SNMP_ERR_NOERROR);
}
int
{
*bogus = 1;
return (SNMP_ERR_NOERROR);
}