/*
     This file is part of GNUnet
     (C) 2004, 2005, 2006 Christian Grothoff (and other contributing authors)

     GNUnet 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, or (at your
     option) any later version.

     GNUnet 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.

     You should have received a copy of the GNU General Public License
     along with GNUnet; see the file COPYING.  If not, write to the
     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.
*/

/**
 * @file include/gnunet_boostrap_service.h
 * @brief API that can be used to bootstrap a GNUnet P2P network
 * @author Christian Grothoff
 */

#ifndef GNUNET_BOOTSTRAP_SERVICE_H
#define GNUNET_BOOTSTRAP_SERVICE_H

#include "gnunet_core.h"

#ifdef __cplusplus
extern "C"
{
#if 0                           /* keep Emacsens' auto-indent happy */
}
#endif
#endif

/**
 * Definition of a callback function that processes
 * hello messages generated by the bootstrap API.
 */
typedef void (*GNUNET_BootstrapHelloCallback) (const GNUNET_MessageHello *
                                               helo, void *arg);

/**
 * @return GNUNET_YES to continue, GNUNET_NO to abort
 */
typedef int (*GNUNET_BootstrapTerminateCallback) (void *arg);

/**
 * @brief Definition of the bootstrap API.
 */
typedef struct
{

  /**
   * Obtain hellos (i.e. by downloading form the web) and call the
   * callback on each hello.
   *
   * @param callback the method to call
   * @param arg extra argument to the method
   */
  void (*bootstrap) (GNUNET_BootstrapHelloCallback callback,
                     void *arg,
                     GNUNET_BootstrapTerminateCallback term, void *targ);

} GNUNET_Bootstrap_ServiceAPI;


#if 0                           /* keep Emacsens' auto-indent happy */
{
#endif
#ifdef __cplusplus
}
#endif


/* end of gnunet_bootstrap_service.h */
#endif
