#Equivalences
#--------------------------------------------------------------------
EXE= \
+ chkdns \
emlrec \
maild \
SRC= \
+ chkdns.c \
emlrec.c \
maild.c \
#--------------------------------------------------------------------
#Dependances
#--------------------------------------------------------------------
+emlrec : toremake emlrec.o
+ @ $(LD) $(LDFLAGS) -o ../bin/$@ $@.o $(LIBS)
+
maild : toremake maild.o
@ $(LD) $(LDFLAGS) -o ../bin/$@ $@.o $(LIBS)
-emlrec : toremake emlrec.o
+chkdns : toremake chkdns.o
@ $(LD) $(LDFLAGS) -o ../bin/$@ $@.o $(LIBS)
+chkdns.o: chkdns.c \
+ ../lib/unidns.h \
+ ../lib/subrou.h
+
emlrec.o: emlrec.c \
../lib/modrec.h \
../lib/unisig.h \
../lib/uniprc.h \
../lib/unipar.h \
- ../lib/subrou.h \
+ ../lib/subrou.h
maild.o : maild.c \
../lib/uniprc.h \
--- /dev/null
+// vim: smarttab tabstop=8 shiftwidth=2 expandtab
+/********************************************************/
+/* */
+/* Main SMTP Daemon */
+/* */
+/********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "subrou.h"
+#include "unidns.h"
+
+/*
+\f
+*/
+/********************************************************/
+/* */
+/* Main routine */
+/* Return an SPF status according arguments*/
+/* 1 - Domain name */
+/* 2 - IP */
+/* */
+/********************************************************/
+int main(int argc,char *argv[])
+
+{
+int status;
+int phase;
+_Bool proceed;
+
+status=0;
+phase=0;
+proceed=true;
+while (proceed==true) {
+ switch (phase) {
+ case 0 : //checking parameters
+ break;
+ case 1 : //initialising process
+ (void) rou_modesubrou(true);
+ break;
+ case 2 : //doing main tash
+ break;
+ case 3 : //doing main tash
+ (void) rou_modesubrou(false);
+ break;
+ default : //end of task
+ proceed=false;
+ break;
+ }
+ phase++;
+ }
+(void) exit(status);
+}
lvleml.o \
gestcp.o \
devlog.o devsoc.o \
- unieml.o \
+ unidns.o unieml.o \
unipar.o uniprc.o unisig.o unitls.o \
subrou.o
unitls.h \
devsoc.h devsoc.c
+unidns.o: \
+ subrou.h \
+ unidns.h unidns.c
+
unieml.o: \
subrou.h \
unieml.h unieml.c
//version definition
-#define VERSION "0.4.1"
-#define RELEASE "6"
+#define VERSION "0.4.2"
+#define RELEASE "1"
//Public variables
PUBLIC int debug=0; //debug level
--- /dev/null
+// vim: smarttab tabstop=8 shiftwidth=2 expandtab
+/********************************************************/
+/* */
+/* Implement all routine to manage SMTP low level */
+/* exchange. */
+/* */
+/********************************************************/
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "subrou.h"
+#include "unidns.h"
+
+static _Bool modopen; //module open/close status
+
+/*
+^L
+*/
+/********************************************************/
+/* */
+/* Procedure to "open/close" module and do */
+/* homework purpose */
+/* return zero if everything right */
+/* */
+/********************************************************/
+int dns_modeunidns(_Bool mode)
+
+{
+#define OPEP "unidoc.c:soc_modeunisoc"
+
+int status;
+
+status=0;
+if (mode!=modopen) {
+ (void) rou_modesubrou(mode);
+ switch ((int)mode) {
+ case true :
+ break;
+ case false :
+ break;
+ default :
+ (void) fprintf(stderr,"Calling %s with wrong mode='%d' (Bug?!):",
+ OPEP,(int)mode);
+ status=-1;
+ break;
+ }
+ modopen=mode;
+ }
+return status;
+#undef OPEP
+}
--- /dev/null
+// vim: smarttab tabstop=8 shiftwidth=2 expandtab
+/********************************************************/
+/* */
+/* Define all procedure to check SPF entry within */
+/* DNS record. */
+/* */
+/********************************************************/
+#ifndef UNIDNS
+#define UNIDNS
+
+//homework to be done before starting/stopping module.
+extern int dns_modeunidns(_Bool mode);
+
+#endif
status=0;
if (mode!=modopen) {
+ (void) rou_modesubrou(mode);
switch ((int)mode) {
case true :
break;