1 /* 2 * jnettop, network online traffic visualiser 3 * Copyright (C) 2002-2005 Jakub Skopal 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * 19 * $Header: /cvsroot/jnettop/jnettop/jresolver.h,v 1.4 2005/07/01 10:25:37 merunka Exp $ 20 * 21 */ 22 23 #ifndef __JRESOLVER_H__ 24 #define __JRESOLVER_H__ 25 26 #include "jbase.h" 27 28 #define LOOKUPTYPE_UNKNOWN 0 29 #define LOOKUPTYPE_NORMAL 1 30 #define LOOKUPTYPE_EXTERNAL 2 31 32 typedef struct __jresolver_resolvertype { 33 int af; 34 jbase_mutableaddress mask; 35 jbase_mutableaddress value; 36 int lookupType; 37 char *externalLookupScript; 38 } jresolver_resolvertype; 39 40 typedef void (*ResolvedNotifyFunc) (jbase_resolv_entry *entry); 41 42 gboolean jresolver_Setup(); 43 void jresolver_Initialize(); 44 void jresolver_Shutdown(); 45 void jresolver_SetEnabled(gboolean isEnabled); 46 jbase_resolv_entry *jresolver_Lookup(int af, const jbase_mutableaddress *address); 47 void jresolver_AddExternalLookupScript(int af, const jbase_mutableaddress *mask, const jbase_mutableaddress *value, char *lookupScriptName); 48 void jresolver_AddNormalLookup(int af, const jbase_mutableaddress *mask, const jbase_mutableaddress *value); 49 void jresolver_SetResolvedNotifyFunc(ResolvedNotifyFunc resolvedNotifyFunction); 50 51 extern gboolean jresolver_IsEnabled; 52 extern ResolvedNotifyFunc jresolver_ResolvedNotifyFunc; 53 54 #endif 55