1 | /*************************************** 2 | $Revision: 1.7 $ 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 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 | 35 | #include <stdarg.h> 36 | #include <stdio.h> 37 | #include <strings.h> 38 | #include <unistd.h> 39 | #include <stdlib.h> 40 | #include <glib.h> 41 | #include "UP_util.h" 42 | 43 | typedef struct { 44 | GSList * less_spec; 45 | GSList * exact_match; 46 | GSList * more_spec; 47 | } overlap_routes; 48 | 49 | 50 | extern int tracing; 51 | extern int reading_from_mail; 52 | /* global config variables */ 53 | extern char *tmpdir; 54 | extern char *notitxt; 55 | extern char *fwtxt; 56 | extern char *humailbox; 57 | extern char *notimailtxt; 58 | extern char *fwmailtxt; 59 | extern char *query_host; 60 | extern int query_port; 61 | extern char *cn_subject_add; 62 | extern char *cn_subject_del; 63 | extern char *cn_explain_add; 64 | extern char *cn_explain_del; 65 | extern char *cn_overlap_add; 66 | extern char *cn_overlap_del; 67 | extern char *cno_subject_add; 68 | extern char *cno_subject_del; 69 | extern char *cno_explain_add; 70 | extern char *cno_explain_del; 71 | extern char *cno_overlap_add; 72 | extern char *cno_overlap_del; 73 | 74 | #define ADDITION 0 75 | #define DELETION 1 76 | 77 | char * NT_ntfy_filename_generate( const char * tmpdir, const char * e_mail); 78 | 79 | char * NT_forwd_filename_generate( const char * tmpdir, const char * e_mail); 80 | 81 | char * NT_crossntfy_filename_generate( const char * tmpdir, const char * e_mail); 82 | 83 | void NT_add_to_ntfy( char * filename, char * fmt, ... ); 84 | 85 | void NT_send_ntfy( const char * filename, const char * to_address, const char * mailercommand); 86 | 87 | void NT_log_ntfy( const char * filename, const char * logfilename); 88 | 89 | void NT_delete_ntfy( const char * filename); 90 | 91 | void NT_send_ntfy_list( GHashTable * filehash, char * mailercommand); 92 | 93 | void NT_log_ntfy_list( GHashTable * filehash, char * log_file); 94 | 95 | void NT_delete_ntfy_list( GHashTable * filehash); 96 | 97 | GSList * NT_gather_ntfy_addresses( const char * old_object, const char * new_object); 98 | 99 | void NT_write_all_ntfs(char * old_object, char * new_object, /*const char * notif_log, 100 | const char * forw_log, const char * cross_log,*/ const char * tempdir, 101 | GHashTable * ntfy_hash, GHashTable * forwd_hash, GHashTable * cross_hash, 102 | char * from_address); 103 | 104 | void NT_write_all_frwds(char * old_object, char * new_object, /*const char * notif_log, 105 | const char * forw_log, const char * cross_log,*/ const char * tempdir, 106 | GHashTable * ntfy_hash, GHashTable * forwd_hash, GHashTable * cross_hash, 107 | const char * from_address); 108 |