#ifndef _AGENT_UTIL_H_1f77ad2e_ #define _AGENT_UTIL_H_1f77ad2e_ /* This file is in the public domain. */ #include /* * Agent-related utilities. */ typedef struct agent_constraints AGENT_CONSTRAINTS; /* * An AGENT_CONSTRAINTS summarizes the supported constraints for an * agent key. time is the timeout, in seconds; use is the maximum use * count; fwd is the maximum forwarding hops; and confirm is the * "operations need user confirmation" boolean. (initted is a boolean * indicating whether the structure has been initialized; if false, * the rest of the elements are meaningless.) */ struct agent_constraints { int initted; unsigned int time; unsigned int use; unsigned int fwd; int confirm; } ; /* * reinit_constraints(c) initializes an AGENT_CONSTRAINTS, or resets an * already-initialized one to the defaults. */ extern void reinit_constraints(AGENT_CONSTRAINTS *); /* * set_constraints(c,data,len,errf) takes a string-and-length (data and * len) and applies the constraints in it to c. errf has errors * printed to it on error. The return value is 0 on success or 1 * (with a message to errf) on failure. */ extern int set_constraints(AGENT_CONSTRAINTS *, const char *, int, FILE *); #endif