1bcc332bdSBrian Somers /* 2bcc332bdSBrian Somers * $Id:$ 3bcc332bdSBrian Somers */ 4bcc332bdSBrian Somers 5bcc332bdSBrian Somers struct iplist { 6bcc332bdSBrian Somers struct iplist_cur { 7bcc332bdSBrian Somers struct in_addr ip; 8bcc332bdSBrian Somers int pos; 9bcc332bdSBrian Somers char *srcptr; 10bcc332bdSBrian Somers int srcitem; 11bcc332bdSBrian Somers u_long lstart, nItems; 12bcc332bdSBrian Somers } cur; 13bcc332bdSBrian Somers int nItems; 14bcc332bdSBrian Somers char src[LINE_LEN]; 15bcc332bdSBrian Somers }; 16bcc332bdSBrian Somers 17bcc332bdSBrian Somers extern int iplist_setsrc(struct iplist *, const char *); 18bcc332bdSBrian Somers extern void iplist_reset(struct iplist *); 19bcc332bdSBrian Somers extern struct in_addr iplist_setcurpos(struct iplist *, int); 20bcc332bdSBrian Somers extern struct in_addr iplist_setrandpos(struct iplist *); 21bcc332bdSBrian Somers extern int iplist_ip2pos(struct iplist *, struct in_addr); 22bcc332bdSBrian Somers extern struct in_addr iplist_next(struct iplist *); 23bcc332bdSBrian Somers 24bcc332bdSBrian Somers #define iplist_isvalid(x) ((x)->src[0] != '\0') 25