aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmail-smtpc/qmail-smtpc.h
blob: 05431c8ce6cd8e542b16c87a1887d2ddb5c180fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* ISC license. */

#ifndef QMAIL_SMTPC_H
#define QMAIL_SMTPC_H

#include <stddef.h>
#include <stdint.h>

#include <skalibs/cdb.h>
#include <skalibs/stralloc.h>
#include <skalibs/genalloc.h>

#include "qmailr.h"

#define dienomem() qmailr_tempsys("Unable to grow stralloc")


/* dns */

typedef struct mxip_s mxip, *mxip_ref ;
struct mxip_s
{
  size_t pos4 ;
  size_t pos6 ;
  uint16_t n4 ;
  uint16_t n6 ;
} ;
#define MXIP_ZERO { 0 }

extern void dns_init (void) ;
extern void dns_canon (char const *, char const *const *, unsigned int, size_t *, genalloc *, stralloc *) ;
extern void dns_ip_of_mx (size_t const *, unsigned int, mxip *, stralloc *, char const *, unsigned int, char const *, unsigned int) ;


/* smtproutes */

typedef struct smtproutes_s smtproutes ;
struct smtproutes_s
{
  cdb map ;
} ;
#define SMTPROUTES_ZERO { .map = CDB_ZERO }

extern int smtproutes_init (smtproutes *) ;
extern int smtproutes_match (smtproutes const *, char const *, stralloc *, size_t *, uint16_t *) ;
extern void smtproutes_free (smtproutes *) ;

#endif