sae_match.c,v

来自「TCP-IP红宝书源代码」· C,V 代码 · 共 66 行

C,V
66
字号
head	1.1;
access;
symbols;
locks
	dls:1.1; strict;
comment	@ * @;


1.1
date	97.09.21.19.29.17;	author dls;	state Dist;
branches;
next	;


desc
@@


1.1
log
@pre-3e code
@
text
@/* sae_match.c - sae_match */

#include <conf.h>
#include <kernel.h>
#include <network.h>

#ifdef	SNMP

#include <snmp.h>
#include <mib.h>
#include <asn1.h>
#include <snhash.h>

/*------------------------------------------------------------------------
 * sae_match - check if a variable exists in the IP Address Entry Table
 *------------------------------------------------------------------------
 */
int sae_match(bindl, iface, field, numifaces)
struct snbentry *bindl;
int		*iface;
int		*field;
int		numifaces;
{
	int 	oidi;

	oidi = SAE_OIDLEN;	/* skip over fixed part of objid */

	if ((*field = bindl->sb_oid.id[oidi++]) > SNUMF_AETAB)
		return SYSERR;
	for (*iface = 1; *iface <= numifaces; (*iface)++)
		if (soipequ(&bindl->sb_oid.id[oidi],
				nif[*iface].ni_ip, IP_ALEN))
			break;
	if (*iface > numifaces)
		return SYSERR;
	oidi += IP_ALEN;
	if (oidi != bindl->sb_oid.len)	/* verify oidi at end of objid	*/
		return SYSERR;
	return OK;
}
#endif	/* SNMP */
@

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?