1 | /*************************************** 2 | $Revision: 1.16 $ 3 | 4 | NT (Notifications) module 5 | 6 | Status: NOT REVIEWED, NOT TESTED 7 | 8 | Author(s): Engin Gunduz 9 | 10 | ******************/ /****************** 11 | Modification History: 12 | engin (06/07/2000) Created. 13 | ******************/ /****************** 14 | Copyright (c) 2000,2001,2002 RIPE NCC 15 | 16 | All Rights Reserved 17 | 18 | Permission to use, copy, modify, and distribute this software and its 19 | documentation for any purpose and without fee is hereby granted, 20 | provided that the above copyright notice appear in all copies and that 21 | both that copyright notice and this permission notice appear in 22 | supporting documentation, and that the name of the author not be 23 | used in advertising or publicity pertaining to distribution of the 24 | software without specific, written prior permission. 25 | 26 | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 27 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL 28 | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 29 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 30 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 31 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 32 | ***************************************/ 33 | 34 | #ifndef NOTIFICATION_H 35 | #define NOTIFICATION_H 36 | 37 | 38 | #include <stdarg.h> 39 | #include <stdio.h> 40 | #include <strings.h> 41 | #include <unistd.h> 42 | #include <stdlib.h> 43 | #include <time.h> 44 | #include <glib.h> 45 | #include "UP_util.h" 46 | 47 | typedef struct { 48 | GList * less_spec; 49 | GList * exact_match; 50 | GList * more_spec; 51 | } overlap_routes; 52 | 53 | 54 | extern int tracing; 55 | extern int reading_from_mail; 56 | extern int networkupdate; 57 | /* global config variables */ 58 | extern char *mailcmd; 59 | extern char *tmpdir; 60 | extern char *notitxt; 61 | extern char *notihdr; 62 | extern char *fwtxt; 63 | extern char *fwhdr; 64 | extern char *humailbox; 65 | extern char *notimailtxt; 66 | extern char *notinetworktxt; 67 | extern char *fwmailtxt; 68 | extern char *mtfwheader; 69 | extern char *mtfwtxt; 70 | extern char *query_host; 71 | extern int query_port; 72 | extern char *cn_subject_add; 73 | extern char *cn_subject_del; 74 | extern char *cn_explain_add; 75 | extern char *cn_explain_del; 76 | extern char *cn_overlap_add; 77 | extern char *cn_overlap_del; 78 | extern char *cno_subject_add; 79 | extern char *cno_subject_del; 80 | extern char *cno_explain_add; 81 | extern char *cno_explain_del; 82 | extern char *cno_overlap_add; 83 | extern char *cno_overlap_del; 84 | 85 | #define ADDITION 0 86 | #define DELETION 1 87 | 88 | char * NT_ntfy_filename_generate( const char * tmpdir, const char * e_mail); 89 | 90 | char * NT_forwd_filename_generate( const char * tmpdir, const char * e_mail); 91 | 92 | char * NT_crossntfy_filename_generate( const char * tmpdir, const char * e_mail); 93 | 94 | void NT_add_to_ntfy( char * filename, char * fmt, ... ); 95 | 96 | void NT_send_ntfy( const char * filename, const char * to_address, const char * mailercommand); 97 | 98 | void NT_log_ntfy( const char * filename, const char * logfilename); 99 | 100 | void NT_delete_ntfy( const char * filename); 101 | 102 | void NT_send_ntfy_list( GHashTable * filehash, char * mailercommand); 103 | 104 | void NT_log_ntfy_list( GHashTable * filehash, char * log_file); 105 | 106 | void NT_delete_ntfy_list( GHashTable * filehash); 107 | 108 | GList * NT_gather_ntfy_addresses( const char * old_object, const char * new_object); 109 | 110 | GList *NT_compare_lists(GList *old_irts, GList *new_irts, int option); 111 | 112 | void NT_write_all_ntfs(char * old_object, char * new_object, char * formatted_object, 113 | const char * tempdir, GHashTable * ntfy_hash, 114 | GHashTable * forwd_hash, GHashTable * cross_hash, 115 | char * from_address); 116 | 117 | void NT_write_all_frwds(char * old_object, char * new_object, const char * tempdir, 118 | GHashTable * ntfy_hash, GHashTable * forwd_hash, GHashTable * cross_hash, 119 | const char * from_address); 120 | 121 | void NT_forw_create_req(const char * object); 122 | 123 | 124 | #endif