/* Copyright 1998, Merit Network, Inc. and the University of Michigan */
/* $Id: notifyif.c,v 1.5 1999/09/06 19:33:31 labovit Exp $
 * originally Id: synchkif.c,v 1.1 1998/08/10 19:23:47 dogcow Exp  */

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <regex.h>
#include <stdlib.h>
#include <errno.h>

/* #include <mrt.h>*/
#include <irrauth.h>
#include "irr_notify.h"


int callnotify (trace_t *tr, char *infn, int null_submission,
		int null_notification, int dump_stdout, char *irrd_host, int irrd_port, 
		char *db_admin, FILE *ack_fd) {
  FILE *infile, *outfile;

  umask (0000);
  infile = fopen (infn, "r+");
  if (NULL == infile) {
    fprintf(stderr, "callnotify (): Error opening input file %s: %s(%d).\n", 
	    infn, strerror(errno), errno);
    return -1;
  }
  
  notify (tr, (char *) tmpfntmpl, infile, null_submission, 
	  null_notification, dump_stdout, irrd_host, irrd_port, 
	  db_admin, ack_fd);

  fclose (infile);

  return 0;
}

