1
0
Files
irix-657m-src/irix/cmd/netman/lib/sn_match.c
2022-09-29 17:59:04 +03:00

39 lines
756 B
C

/*
* Copyright 1988 Silicon Graphics, Inc. All rights reserved.
*
* Snooper expression evaluation functions.
*/
#include "protocol.h"
#include "snooper.h"
/*
* Return 1 if sp matches sn's expression filter, 0 otherwise.
* If sn_expr is null the filter is promiscuous.
*/
int
sn_match(Snooper *sn, SnoopPacket *sp, int len)
{
if (sn->sn_expr == 0)
return 1;
return SN_TEST(sn, sn->sn_expr, sp, len);
}
/*
* Functional form of SN_TEST.
*/
int
sn_test(Snooper *sn, struct expr *ex, SnoopPacket *sp, int len)
{
return SN_TEST(sn, ex, sp, len);
}
/*
* Functional form of SN_EVAL.
*/
int
sn_eval(Snooper *sn, struct expr *ex, SnoopPacket *sp, int len,
struct exprerror *err, struct expr *rex)
{
return SN_EVAL(sn, ex, sp, len, err, rex);
}