+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* LDP SNMP support
* Copyright (C) 2020 Volta Networks, Inc.
- *
- * 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; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
#include "memory.h"
#include "smux.h"
#include "libfrr.h"
-#include "version.h"
+#include "lib/version.h"
#include "ldpd.h"
#include "ldpe.h"
/* Append index */
*length = LDP_ENTITY_TOTAL_LEN;
- oid_copy_addr(name + v->namelen, &entityLdpId,
- IN_ADDR_SIZE);
+ oid_copy_in_addr(name + v->namelen, &entityLdpId);
name[v->namelen + 4] = 0;
name[v->namelen + 5] = 0;
name[v->namelen + 6] = LDP_DEFAULT_ENTITY_INDEX;
/* Append index */
*length = LDP_ENTITY_TOTAL_LEN;
- oid_copy_addr(name + v->namelen, &entityLdpId,
- IN_ADDR_SIZE);
+ oid_copy_in_addr(name + v->namelen, &entityLdpId);
name[v->namelen + 4] = 0;
name[v->namelen + 5] = 0;
name[v->namelen + 6] = LDP_DEFAULT_ENTITY_INDEX;
struct in_addr peerLdpId = ctl_adj->id;
- oid_copy_addr(name + v->namelen, &entityLdpId,
- sizeof(struct in_addr));
+ oid_copy_in_addr(name + v->namelen, &entityLdpId);
name[v->namelen + 4] = 0;
name[v->namelen + 5] = 0;
name[v->namelen + 6] = LDP_DEFAULT_ENTITY_INDEX;
- oid_copy_addr(name + v->namelen + 7, &peerLdpId,
- sizeof(struct in_addr));
+ oid_copy_in_addr(name + v->namelen + 7, &peerLdpId);
name[v->namelen + 11] = 0;
name[v->namelen + 12] = 0;
name[v->namelen + 13] = adjacencyIndex;
memcpy(name, v->name, v->namelen * sizeof(oid));
/* Append index */
- oid_copy_addr(name + v->namelen, &entityLdpId,
- sizeof(struct in_addr));
+ oid_copy_in_addr(name + v->namelen, &entityLdpId);
name[v->namelen + 4] = 0;
name[v->namelen + 5] = 0;
name[v->namelen + 6] = entityIndex;
- oid_copy_addr(name + v->namelen + 7, &peerLdpId,
- sizeof(struct in_addr));
+ oid_copy_in_addr(name + v->namelen + 7, &peerLdpId);
name[v->namelen + 11] = 0;
name[v->namelen + 12] = 0;
memcpy(name, v->name, v->namelen * sizeof(oid));
/* Append index */
- oid_copy_addr(name + v->namelen, &entityLdpId,
- sizeof(struct in_addr));
+ oid_copy_in_addr(name + v->namelen, &entityLdpId);
name[v->namelen + 4] = 0;
name[v->namelen + 5] = 0;
name[v->namelen + 6] = entityIndex;
- oid_copy_addr(name + v->namelen + 7, &peerLdpId,
- sizeof(struct in_addr));
+ oid_copy_in_addr(name + v->namelen + 7, &peerLdpId);
name[v->namelen + 11] = 0;
name[v->namelen + 12] = 0;
memcpy(name, v->name, v->namelen * sizeof(oid));
/* Append index */
- oid_copy_addr(name + v->namelen, &entityLdpId,
- sizeof(struct in_addr));
+ oid_copy_in_addr(name + v->namelen, &entityLdpId);
name[v->namelen + 4] = 0;
name[v->namelen + 5] = 0;
name[v->namelen + 6] = entityIndex;
- oid_copy_addr(name + v->namelen + 7, &peerLdpId,
- sizeof(struct in_addr));
+ oid_copy_in_addr(name + v->namelen + 7, &peerLdpId);
name[v->namelen + 11] = 0;
name[v->namelen + 12] = 0;
entityIndex = LDP_DEFAULT_ENTITY_INDEX;
peerLdpId = ctl_nbr->id;
- oid_copy_addr(index, &entityLdpId, sizeof(struct in_addr));
- index[4] = 0;
- index[5] = 0;
- index[6] = entityIndex;
- oid_copy_addr(&index[7], &peerLdpId, sizeof(struct in_addr));
- index[11] = 0;
- index[12] = 0;
+ oid_copy_in_addr(index, &entityLdpId);
+ index[4] = 0;
+ index[5] = 0;
+ index[6] = entityIndex;
+ oid_copy_in_addr(&index[7], &peerLdpId);
+ index[11] = 0;
+ index[12] = 0;
- index[LDP_PEER_ENTRY_MAX_IDX_LEN] = 0;
+ index[LDP_PEER_ENTRY_MAX_IDX_LEN] = 0;
smux_trap(ldpe_variables, array_size(ldpe_variables), ldp_trap_oid,
array_size(ldp_trap_oid), ldp_oid,
ldpTrapSession(nbr, LDPSESSIONDOWN);
}
-static int ldp_snmp_agentx_enabled()
+static int ldp_snmp_agentx_enabled(void)
{
main_imsg_compose_both(IMSG_AGENTX_ENABLED, NULL, 0);