bsnmptools.c (440cec3faf778469b36b998bb52aab7fbc43eae3) bsnmptools.c (8b223768d19d2b0f0d544daf81553c2cb7293f10)
1/*-
2 * Copyright (c) 2005-2006 The FreeBSD Project
3 * All rights reserved.
4 *
5 * Author: Shteryana Shopova <syrinx@FreeBSD.org>
6 *
7 * Redistribution of this software and documentation and use in source and
8 * binary forms, with or without modification, are permitted provided that

--- 38 unchanged lines hidden (view full) ---

47#include <unistd.h>
48
49#include <bsnmp/asn1.h>
50#include <bsnmp/snmp.h>
51#include <bsnmp/snmpclient.h>
52#include "bsnmptc.h"
53#include "bsnmptools.h"
54
1/*-
2 * Copyright (c) 2005-2006 The FreeBSD Project
3 * All rights reserved.
4 *
5 * Author: Shteryana Shopova <syrinx@FreeBSD.org>
6 *
7 * Redistribution of this software and documentation and use in source and
8 * binary forms, with or without modification, are permitted provided that

--- 38 unchanged lines hidden (view full) ---

47#include <unistd.h>
48
49#include <bsnmp/asn1.h>
50#include <bsnmp/snmp.h>
51#include <bsnmp/snmpclient.h>
52#include "bsnmptc.h"
53#include "bsnmptools.h"
54
55/* Internal varibale to turn on library debugging for testing and to
55/* Internal variable to turn on library debugging for testing and to
56 * find bugs. It is not exported via the header file.
57 * XXX should we cover it by some #ifdef BSNMPTOOLS_DEBUG? */
58int _bsnmptools_debug = 0;
59
60/* Default files to import mapping from if none explicitly provided. */
61#define bsnmpd_defs "/usr/share/snmp/defs/tree.def"
62#define mibII_defs "/usr/share/snmp/defs/mibII_tree.def"
63

--- 1271 unchanged lines hidden (view full) ---

1335
1336 suboid = var->subs[--(var->len)];
1337 var->subs[var->len] = 0;
1338
1339 return (suboid);
1340}
1341
1342/*
56 * find bugs. It is not exported via the header file.
57 * XXX should we cover it by some #ifdef BSNMPTOOLS_DEBUG? */
58int _bsnmptools_debug = 0;
59
60/* Default files to import mapping from if none explicitly provided. */
61#define bsnmpd_defs "/usr/share/snmp/defs/tree.def"
62#define mibII_defs "/usr/share/snmp/defs/mibII_tree.def"
63

--- 1271 unchanged lines hidden (view full) ---

1335
1336 suboid = var->subs[--(var->len)];
1337 var->subs[var->len] = 0;
1338
1339 return (suboid);
1340}
1341
1342/*
1343 * Parse the command-line provided string into an OID - alocate memory for a new
1343 * Parse the command-line provided string into an OID - allocate memory for a new
1344 * snmp object, fill in its fields and insert it in the object list. A
1345 * (snmp_verify_inoid_f) function must be provided to validate the input string.
1346 */
1347int32_t
1348snmp_object_add(struct snmp_toolinfo *snmptoolctx, snmp_verify_inoid_f func,
1349 char *string)
1350{
1351 struct snmp_object *obj;

--- 787 unchanged lines hidden ---
1344 * snmp object, fill in its fields and insert it in the object list. A
1345 * (snmp_verify_inoid_f) function must be provided to validate the input string.
1346 */
1347int32_t
1348snmp_object_add(struct snmp_toolinfo *snmptoolctx, snmp_verify_inoid_f func,
1349 char *string)
1350{
1351 struct snmp_object *obj;

--- 787 unchanged lines hidden ---