mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 21:10:28 +00:00
[cleanup] Use const in smux interface
smux_trap and oid_copy should allow read-only source.
This commit is contained in:
parent
9bddac4bd5
commit
65d3fbb483
16
lib/smux.c
16
lib/smux.c
@ -83,7 +83,7 @@ static struct cmd_node smux_node =
|
|||||||
static struct thread_master *master;
|
static struct thread_master *master;
|
||||||
|
|
||||||
void *
|
void *
|
||||||
oid_copy (void *dest, void *src, size_t size)
|
oid_copy (void *dest, const void *src, size_t size)
|
||||||
{
|
{
|
||||||
return memcpy (dest, src, size * sizeof (oid));
|
return memcpy (dest, src, size * sizeof (oid));
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ oid_compare_part (oid *o1, int o1_len, oid *o2, int o2_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
smux_oid_dump (const char *prefix, oid *oid, size_t oid_len)
|
smux_oid_dump (const char *prefix, const oid *oid, size_t oid_len)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int first = 1;
|
int first = 1;
|
||||||
@ -174,7 +174,7 @@ smux_oid_dump (const char *prefix, oid *oid, size_t oid_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
smux_socket ()
|
smux_socket (void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
@ -993,9 +993,9 @@ smux_open (int sock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
smux_trap (oid *name, size_t namelen,
|
smux_trap (const oid *name, size_t namelen,
|
||||||
oid *iname, size_t inamelen,
|
const oid *iname, size_t inamelen,
|
||||||
struct trap_object *trapobj, size_t trapobjlen,
|
const struct trap_object *trapobj, size_t trapobjlen,
|
||||||
unsigned int tick, u_char sptrap)
|
unsigned int tick, u_char sptrap)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -1227,7 +1227,7 @@ smux_connect (struct thread *t)
|
|||||||
|
|
||||||
/* Clear all SMUX related resources. */
|
/* Clear all SMUX related resources. */
|
||||||
static void
|
static void
|
||||||
smux_stop ()
|
smux_stop (void)
|
||||||
{
|
{
|
||||||
if (smux_read_thread)
|
if (smux_read_thread)
|
||||||
{
|
{
|
||||||
@ -1388,7 +1388,7 @@ smux_header_generic (struct variable *v, oid *name, size_t *length, int exact,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
smux_peer_default ()
|
smux_peer_default (void)
|
||||||
{
|
{
|
||||||
if (smux_oid)
|
if (smux_oid)
|
||||||
{
|
{
|
||||||
|
@ -150,11 +150,12 @@ extern void smux_register_mib(const char *, struct variable *,
|
|||||||
size_t, int, oid [], size_t);
|
size_t, int, oid [], size_t);
|
||||||
extern int smux_header_generic (struct variable *, oid [], size_t *,
|
extern int smux_header_generic (struct variable *, oid [], size_t *,
|
||||||
int, size_t *, WriteMethod **);
|
int, size_t *, WriteMethod **);
|
||||||
extern int smux_trap (oid *, size_t, oid *, size_t, struct trap_object *,
|
extern int smux_trap (const oid *, size_t, const oid *, size_t,
|
||||||
|
const struct trap_object *,
|
||||||
size_t, unsigned int, u_char);
|
size_t, unsigned int, u_char);
|
||||||
extern int oid_compare (oid *, int, oid *, int);
|
extern int oid_compare (oid *, int, oid *, int);
|
||||||
extern void oid2in_addr (oid [], int, struct in_addr *);
|
extern void oid2in_addr (oid [], int, struct in_addr *);
|
||||||
extern void *oid_copy (void *, void *, size_t);
|
extern void *oid_copy (void *, const void *, size_t);
|
||||||
extern void oid_copy_addr (oid [], struct in_addr *, int);
|
extern void oid_copy_addr (oid [], struct in_addr *, int);
|
||||||
|
|
||||||
#endif /* _ZEBRA_SNMP_H */
|
#endif /* _ZEBRA_SNMP_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user