---
name: "netsnmp_scalar"
section: "3snmp"
platform: "linux"
package: "libsnmp-dev"
version: "5.4.3~dfsg-2.8+deb7u1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/netsnmp_scalar"
---

# netsnmp\_scalar(3snmp)

Process scalars easily.

## NAME

scalar -

Process scalars easily.

### Functions

**netsnmp\_mib\_handler** \* **netsnmp\_get\_scalar\_handler** (void)\
 *Creates a scalar handler calling netsnmp\_create\_handler with a handler name defaulted to 'scalar' and access method, netsnmp\_scalar\_helper\_handler.*  int **netsnmp\_register\_scalar** (**netsnmp\_handler\_registration** \*reginfo)\
 *This function registers a scalar helper handler.*  int **netsnmp\_register\_read\_only\_scalar** (**netsnmp\_handler\_registration** \*reginfo)\
 *This function registers a read only scalar helper handler.*  int **netsnmp\_scalar\_helper\_handler** (**netsnmp\_mib\_handler** \*handler, **netsnmp\_handler\_registration** \*reginfo, **netsnmp\_agent\_request\_info** \*reqinfo, **netsnmp\_request\_info** \*requests)\

## Detailed Description

Process scalars easily.

## Function Documentation

### netsnmp\_mib\_handler\* netsnmp\_get\_scalar\_handler (void)

Creates a scalar handler calling netsnmp\_create\_handler with a handler name defaulted to 'scalar' and access method, netsnmp\_scalar\_helper\_handler. **Returns:**

Returns a pointer to a netsnmp\_mib\_handler struct which contains the handler's name and the access method

**See also:**

**netsnmp\_get\_scalar\_handler**

**netsnmp\_register\_scalar**

Definition at line 46 of file scalar.c.

### int netsnmp\_register\_read\_only\_scalar (netsnmp\_handler\_registration \* reginfo)

This function registers a read only scalar helper handler. This function is very similar to netsnmp\_register\_scalar the only addition is that the 'read\_only' handler is injected into the handler chain prior to injecting the serialize handler and registering reginfo.

**Parameters:**

*reginfo* a handler registration structure which could get created using netsnmp\_create\_handler\_registration. Used to register a read only scalar helper handler.

**Returns:**

MIB\_REGISTERED\_OK is returned if the registration was a success. Failures are MIB\_REGISTRATION\_FAILURE and MIB\_DUPLICATE\_REGISTRATION.

**See also:**

**netsnmp\_register\_scalar**

**netsnmp\_get\_scalar\_handler**

Definition at line 109 of file scalar.c.

### int netsnmp\_register\_scalar (netsnmp\_handler\_registration \* reginfo)

This function registers a scalar helper handler. The registered OID, reginfo-\>rootoid, space is extended for the instance subid using realloc() but the reginfo-\>rootoid\_len length is not extended just yet. .This function subsequently injects the instance, scalar, and serialize helper handlers before actually registering reginfo.

Each handler is injected/pushed to the top of the handler chain list and will be processed last in first out, LIFO.

**Parameters:**

*reginfo* a handler registration structure which could get created using netsnmp\_create\_handler\_registration. Used to register a scalar helper handler.

**Returns:**

MIB\_REGISTERED\_OK is returned if the registration was a success. Failures are MIB\_REGISTRATION\_FAILURE and MIB\_DUPLICATE\_REGISTRATION.

**See also:**

**netsnmp\_register\_read\_only\_scalar**

**netsnmp\_get\_scalar\_handler**

Definition at line 74 of file scalar.c.

## Author

Generated automatically by Doxygen for net-snmp from the source code.
