| 1 |
root |
1.1 |
/* libspf - Sender Policy Framework library |
| 2 |
|
|
* |
| 3 |
|
|
* ANSI C implementation of spf-draft-200405.txt |
| 4 |
|
|
* |
| 5 |
|
|
* Author: James Couzens <jcouzens@codeshare.ca> |
| 6 |
|
|
* |
| 7 |
|
|
* File: spfqtool.c |
| 8 |
|
|
* Desc: SPF Query Tool (an example implementation of libSPF) |
| 9 |
|
|
* |
| 10 |
|
|
* License: |
| 11 |
|
|
* |
| 12 |
|
|
* The libspf Software License, Version 1.0 |
| 13 |
|
|
* |
| 14 |
|
|
* Copyright (c) 2004 James Couzens & Sean Comeau All rights |
| 15 |
|
|
* reserved. |
| 16 |
|
|
* |
| 17 |
|
|
* Redistribution and use in source and binary forms, with or without |
| 18 |
|
|
* modification, are permitted provided that the following conditions |
| 19 |
|
|
* are met: |
| 20 |
|
|
* |
| 21 |
|
|
* 1. Redistributions of source code must retain the above copyright |
| 22 |
|
|
* notice, this list of conditions and the following disclaimer. |
| 23 |
|
|
* |
| 24 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
| 25 |
|
|
* notice, this list of conditions and the following disclaimer in |
| 26 |
|
|
* the documentation and/or other materials provided with the |
| 27 |
|
|
* distribution. |
| 28 |
|
|
* |
| 29 |
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
| 30 |
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 31 |
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 32 |
|
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHORS MAKING USE OF THIS LICESEN |
| 33 |
|
|
* OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 34 |
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 35 |
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
| 36 |
|
|
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 37 |
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 38 |
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 39 |
|
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 40 |
|
|
* SUCH DAMAGE. |
| 41 |
|
|
* |
| 42 |
|
|
*/ |
| 43 |
|
|
|
| 44 |
|
|
#ifndef _SPF_QTOOL_H |
| 45 |
|
|
#define _SPF_QTOOL_H 1 |
| 46 |
|
|
|
| 47 |
|
|
#include "../../config.h" /* autoconf */ |
| 48 |
|
|
#include <stdio.h> /* printf */ |
| 49 |
|
|
#include <stdlib.h> /* malloc */ |
| 50 |
|
|
#include <string.h> /* free */ |
| 51 |
|
|
#include "../libspf/spf.h" /* libSPF */ |
| 52 |
|
|
#include "../libspf/_stdint.h" /* our stdint header */ |
| 53 |
|
|
|
| 54 |
|
|
|
| 55 |
|
|
#ifdef __BEGIN_DECLS |
| 56 |
|
|
__BEGIN_DECLS |
| 57 |
|
|
#else |
| 58 |
|
|
# ifdef __cplusplus |
| 59 |
|
|
extern "C" { |
| 60 |
|
|
# endif /* __cplusplus */ |
| 61 |
|
|
#endif /* __BEGIN_DECLS */ |
| 62 |
|
|
|
| 63 |
|
|
#define SPFQTOOL_VERSION "0.4" /* version */ |
| 64 |
|
|
#define HELO_HOST "nobody" /* default HELO host if none */ |
| 65 |
|
|
#define HOSTNAME "libspf.org" /* hostname */ |
| 66 |
|
|
|
| 67 |
|
|
int main(int argc, char *argv[]); |
| 68 |
|
|
void SPF_usage(); |
| 69 |
|
|
|
| 70 |
|
|
#ifdef __BEGIN_DECLS |
| 71 |
|
|
__END_DECLS |
| 72 |
|
|
#else |
| 73 |
|
|
# ifdef __cplusplus |
| 74 |
|
|
} |
| 75 |
|
|
# endif /* __cplusplus */ |
| 76 |
|
|
#endif /* __BEGIN_DECLS */ |
| 77 |
|
|
|
| 78 |
|
|
#endif /* _SPF_QTOOL_H */ |
| 79 |
|
|
|
| 80 |
|
|
/* end spfqtool.h */ |