srt_match.c,v
来自「TCP-IP红宝书源代码」· C,V 代码 · 共 65 行
C,V
65 行
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
@/* srt_match.c - srt_match */
#include <conf.h>
#include <kernel.h>
#include <network.h>
#ifdef SNMP
#include <snmp.h>
#include <mib.h>
/*------------------------------------------------------------------------
* srt_match - check if a variable exists in the current Routing Table
*------------------------------------------------------------------------
*/
int srt_match(bindl, rtp, rtl, field)
struct snbentry *bindl;
struct route **rtp;
int *rtl;
int *field;
{
int oidi, i;
Bool found;
oidi = SRT_OIDLEN;
if ((*field = bindl->sb_oid.id[oidi++]) > SNUMF_RTTAB)
return SYSERR;
/* oidi points to IP address to match in the routing table. */
for (found = FALSE, i = 0; !found && i < RT_TSIZE; i++)
for (*rtp = rttable[i]; *rtp; *rtp = (*rtp)->rt_next)
if (found = soipequ(&bindl->sb_oid.id[oidi],
(*rtp)->rt_net, IP_ALEN))
break;
if (!found || /* not there */
oidi + IP_ALEN != bindl->sb_oid.len) /* not end of object id*/
return SYSERR;
*rtl = i - 1;
return OK;
}
#endif /* SNMP */
@
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?