FreeBSD/sys/netpfil/ipfw/ip_fw_sockopt.c
/*
 * Find and reference object (if any) stored in instruction @cmd.
 *
 * Saves object info in @pidx, sets
 *  - @unresolved to 1 if object should exists but not found
 *
 * Returns non-zero value in case of error.
 */
Find and reference object (if any) stored in instruction @cmd.
Saves object info in @pidx, sets
- @unresolved to 1 if object should exists but not found

Returns non-zero value in case of error.
Find and reference object ( if any ) stored in instruction @cmd . Saves object info in @pidx sets - @unresolved to 1 if object should exists but not found Returns non - zero value in case of error .
static int
ref_opcode_object(struct ip_fw_chain *ch, ipfw_insn *cmd, struct tid_info *ti,
    struct obj_idx *pidx, int *unresolved)
{
	struct named_object *no;
	struct opcode_obj_rewrite *rw;
	int error;
	rw = find_op_rw(cmd, &ti->uidx, &ti->type);
	if (rw == NULL)
		return (0);
	pidx->uidx = ti->uidx;
	pidx->type = ti->type;
	error = rw->find_byname(ch, ti, &no);
	if (error != 0)
		return (error);
	if (no == NULL) {
		*unresolved = 1;
		return (0);
	}
	no->refcnt++;
	rw->update(cmd, no->kidx);
	return (0);
}
static int ref_opcode_object ( struct ip_fw_chain * ch , ipfw_insn * cmd , struct tid_info * ti , struct obj_idx * pidx , int * unresolved ) { struct named_object * no ; struct opcode_obj_rewrite * rw ; int error ; rw = find_op_rw ( cmd , & ti -> uidx , & ti -> type ) ; if ( rw == NULL ) return ( 0 ) ; pidx -> uidx = ti -> uidx ; pidx -> type = ti -> type ; error = rw -> find_byname ( ch , ti , & no ) ; if ( error != 0 ) return ( error ) ; if ( no == NULL ) { * unresolved = 1 ; return ( 0 ) ; } no -> refcnt ++ ; rw -> update ( cmd , no -> kidx ) ; return ( 0 ) ; }
Find and reference object (if any) stored in instruction @cmd.
Find and reference object ( if any ) stored in instruction @cmd .
/* Check if this opcode is candidate for rewrite */ /* Need to rewrite. Save necessary fields */ /* Try to find referenced kernel object */ /*
		 * Report about unresolved object for automaic
		 * creation.
		 */ /* Found. Bump refcount and update kidx. */