#ifndef ADDR_LIST_H_INCLUDED
#define ADDR_LIST_H_INCLUDED
#define ADDR_LIST_H_VERSION "$Id: addrlist.h,v 1.2 2003/06/19 15:58:58 lionel Exp $"
/*********************************************************************
 *
 * File        :  $Source: /ds6/cvs/privoxy/src/addrlist.h,v $
 *
 * Purpose     :  Declares functions to handle lists of network addresses.
 *                Functions declared include:
 *                   `destroy_addr_list', head_addr_list and `tail_addr_list'
 *
 * Copyright   :  Written by and Copyright (C) 2002 Lionel Elie Mamane
 *                <lionel@mamane.lu>
 *
 *                This program is free software; you can redistribute it
 *                and/or modify it under the terms of the GNU General
 *                Public License as published by the Free Software
 *                Foundation; either version 2 of the License, or (at
 *                your option) any later version.
 *
 *                This program is distributed in the hope that it will
 *                be useful, but WITHOUT ANY WARRANTY; without even the
 *                implied warranty of MERCHANTABILITY or FITNESS FOR A
 *                PARTICULAR PURPOSE.  See the GNU General Public
 *                License for more details.
 *
 *                The GNU General Public License should be included with
 *                this file.  If not, you can view it at
 *                http://www.gnu.org/copyleft/gpl.html
 *                or write to the Free Software Foundation, Inc., 59
 *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Revisions   :
 *    $Log: addrlist.h,v $
 *    Revision 1.2  2003/06/19 15:58:58  lionel
 *    Fix mask calculation in fill_acl_addr_mask in IPv6 case
 *    Where there's a sockaddr, there's an addrlen. Fixes portability to (Free)BSD.
 *
 *    Revision 1.1  2003/05/23 17:03:47  lionel
 *    Address list implementation
 *
 *
 *********************************************************************/

#include <sys/socket.h>

typedef struct addrinfo addr_list;

addr_list *tail_addr_list(addr_list *l);
struct sockaddr_storage *head_addr_list(addr_list *l);
void cpy_head_addr_list(addr_list *l, struct sockaddr_storage *r, size_t *addrlen);
void destroy_addr_list(addr_list *l);
int is_nil_addr_list(addr_list *l);

#define freez_addr_list(X)  { if(X) { destroy_addr_list(X); X = NULL ; } }

#endif /* ndef LIST_H_INCLUDED */

/*
  Local Variables:
  tab-width: 3
  c-file-style: "stroustrup"
  c-basic-offset: 3
  indent-tabs-mode: nil
  end:
*/
