/*
** custom.c for  in 
** 
** Made by 
** Login   <vianney@epita.fr>
** 
** Started on  Thu Oct 28 20:11:59 1999 
** Last update Tue Nov  2 03:34:18 1999 
*/
/*
 * Example custom program. 
 */

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "pktio.h"
#include "pat_data.h"

t_status		treat_pkt(pkt)
t_pkt			*pkt;
{
  /* modify pkt here */
  return (0);
}

int			main(argc,argv)
int			argc;
char			**argv;
{
  t_pkt			*pkt;
  t_status		status;

  if ((status = err_init()) < 0)
    {
      err_print(-status,"err_init");
      exit(1);
    }
  if ((status = err_pat_init()) < 0)
    {
      err_print(-status,"err_pat_init");
      exit(1);
    }
  a_debug_init();
  pat_debug_init();
  if ((status = pat_init()) < 0)
    {
      err_print(-status,"pat_init");
      exit(1);
    }
  if ((pkt = pkt_new(1,
		     &data_pat,
		     alloc_malloc,
		     free_free,
		     &status)) == NULL)
    {
      err_print(-status,"pkt_new");
      exit(1);
    }
  if ((status = pkt_read(pkt,
			 0,
			 alloc_malloc,
			 free_free)) < 0)
    {
      err_print(-status,"pkt_read");
      exit(1);
    }
  if ((status = treat_pkt(pkt)) < 0)
    {
      err_print(-status,"treat_pkt");
      exit(1);
    }
  if ((status = pkt_write(pkt,
			  1,
			  alloc_malloc,
			  free_free)) < 0)
    {
      err_print(-status,"pkt_write");
      exit(1);
    }
  exit(0);
}
