FreeBSD/sys/netpfil/ipfw/ip_fw_sockopt.c
/*
 * Finds opcode object rewriter based on @code.
 *
 * Returns pointer to handler or NULL.
 */
Finds opcode object rewriter based on @code.
Returns pointer to handler or NULL.
Finds opcode object rewriter based on @code . Returns pointer to handler or NULL .
static struct opcode_obj_rewrite *
find_op_rw(ipfw_insn *cmd, uint16_t *puidx, uint8_t *ptype)
{
	struct opcode_obj_rewrite *rw, *lo, *hi;
	uint16_t uidx;
	uint8_t subtype;
	if (find_op_rw_range(cmd->opcode, &lo, &hi) != 0)
		return (NULL);
	for (rw = lo; rw <= hi; rw++) {
		if (rw->classifier(cmd, &uidx, &subtype) == 0) {
			if (puidx != NULL)
				*puidx = uidx;
			if (ptype != NULL)
				*ptype = subtype;
			return (rw);
		}
	}
	return (NULL);
}
static struct opcode_obj_rewrite * find_op_rw ( ipfw_insn * cmd , uint16_t * puidx , uint8_t * ptype ) { struct opcode_obj_rewrite * rw , * lo , * hi ; uint16_t uidx ; uint8_t subtype ; if ( find_op_rw_range ( cmd -> opcode , & lo , & hi ) != 0 ) return ( NULL ) ; for ( rw = lo ; rw <= hi ; rw ++ ) { if ( rw -> classifier ( cmd , & uidx , & subtype ) == 0 ) { if ( puidx != NULL ) * puidx = uidx ; if ( ptype != NULL ) * ptype = subtype ; return ( rw ) ; } } return ( NULL ) ; }
Finds opcode object rewriter based on @code.
Finds opcode object rewriter based on @code .