Back to index

opendkim  2.6.2
repute.h
Go to the documentation of this file.
00001 /*
00002 **  Copyright (c) 2011, 2012, The OpenDKIM Project.  All rights reserved.
00003 */
00004 
00005 #ifndef lint
00006 static char repute_h_id[] = "$Id$";
00007 #endif /* ! lint */
00008 
00009 #ifndef _REPUTE_H_
00010 #define _REPUTE_H_
00011 
00012 /* system includes */
00013 #include <sys/param.h>
00014 #include <sys/types.h>
00015 
00016 /* constants */
00017 #ifndef FALSE
00018 # define FALSE                     0
00019 #endif /* ! FALSE */
00020 #ifndef TRUE
00021 # define TRUE               1
00022 #endif /* ! TRUE */
00023 
00024 /* status codes */
00025 #define       REPUTE_STAT_UNKNOWN  (-1)   /* unknown status */
00026 #define       REPUTE_STAT_OK              0      /* successful completion */
00027 #define       REPUTE_STAT_INTERNAL 1      /* internal error */
00028 #define       REPUTE_STAT_PARSE    2      /* parse failure */
00029 #define       REPUTE_STAT_QUERY    3      /* query failure */
00030 
00031 #define       REPUTE_CACHE         86400  /* XXX -- make this configurable */
00032 
00033 typedef int REPUTE_STAT;
00034 
00035 /* constant strings */
00036 #define       REPUTE_NAME_REPUTATION      "reputation"
00037 #define       REPUTE_NAME_REPUTON  "reputon"
00038 
00039 #define       REPUTE_URI_APPLICATION      "email-id"
00040 #define       REPUTE_URI_SCHEME    "http"
00041 #define       REPUTE_URI_TEMPLATE  "{scheme}://{service}/.well-known/repute-template"
00042 
00043 #define       REPUTE_XML_CODE_UNKNOWN            (-1)
00044 #define       REPUTE_XML_CODE_ASSERTION   0
00045 #define       REPUTE_XML_CODE_EXTENSION   1
00046 #define       REPUTE_XML_CODE_RATED              2
00047 #define       REPUTE_XML_CODE_RATER              3
00048 #define       REPUTE_XML_CODE_RATER_AUTH  4
00049 #define       REPUTE_XML_CODE_RATING             5
00050 #define       REPUTE_XML_CODE_SAMPLE_SIZE 6
00051 #define       REPUTE_XML_CODE_UPDATED            7
00052 
00053 #define       REPUTE_XML_ASSERTION "assertion"
00054 #define       REPUTE_XML_EXTENSION "extension"
00055 #define       REPUTE_XML_RATED     "rated"
00056 #define       REPUTE_XML_RATER     "rater"
00057 #define       REPUTE_XML_RATER_AUTH       "rater-authenticity"
00058 #define       REPUTE_XML_RATING    "rating"
00059 #define       REPUTE_XML_SAMPLE_SIZE      "sample-size"
00060 #define       REPUTE_XML_UPDATED   "updated"
00061 
00062 #define       REPUTE_ASSERT_SPAM   "spam"
00063 
00064 #define       REPUTE_EXT_ID_BOTH   "IDENTITY: DKIM"
00065 #define       REPUTE_EXT_RATE_COLON       "RATE:"
00066 
00067 #define       REPUTE_EXT_ID        "IDENTITY"
00068 #define       REPUTE_EXT_ID_DKIM   "DKIM"
00069 #define       REPUTE_EXT_RATE             "RATE"
00070 
00071 /* other types */
00072 struct repute_handle;
00073 typedef struct repute_handle * REPUTE;
00074 
00075 /* prototypes */
00076 extern void repute_close(REPUTE);
00077 extern const char * repute_curlversion(REPUTE);
00078 extern const char *repute_error(REPUTE);
00079 extern void repute_init(void);
00080 extern REPUTE repute_new(const char *, unsigned int);
00081 extern REPUTE_STAT repute_query(REPUTE, const char *, float *,
00082                                 float *, unsigned long *, unsigned long *,
00083                                 time_t *);
00084 extern void repute_useragent(REPUTE, const char *);
00085 
00086 #endif /* ! _REPUTE_H_ */