~sbeattie/ubuntu/oneiric/dovecot/dovecot-lp792557

« back to all changes in this revision

Viewing changes to src/director/director-host.h

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-05-16 10:18:41 UTC
  • mfrom: (4.1.20 sid)
  • Revision ID: james.westby@ubuntu.com-20110516101841-wo4hf1ewxssic6xj
Tags: 1:2.0.12-1ubuntu1
* Merge from Debian Unstable, remaining changes are:
  + Add mail-stack-delivery as per server-maverick-mail-integration spec:
    - Update debian/rules
    - Convert existing package to a dummy package and new binary in debian/control.
    - Update maintainer scripts.
    - Move previously installed backups and config files to a new package namespace in preinst.
    - Add new debian/mail-stack-delivery.prerm to handle downgrades.
    - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*
  + Use Snakeoil SSL certifications by default:
    - debian/control: Depend on ssl-cert.
    - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - Create debian/dovecot-common.ufw.profile.
    - debian/rules: install profile
    - debian/control: suggest ufw.
  + debian/{control,rules}: enable PIE hardening.
  + debian/dovecot-common.dirs: Added usr/share/doc/dovecot-common
  + Add apport hook:
    - debian/rules, debian/source_dovecot.py
  + Add upstart job:
    - debian/rules, debian/dovecot-common.dovecot.upstart, debian/control,
      debian/dovecot-common.dirs, dovecot-imapd.{postrm, postinst, prerm},
      debian/dovecot-pop3d.{postinst, postrm, prerm}. mail-stack-deliver.postinst:
      Convert init script to upstart. Apart of the server-maverick-upstart-conversion
      specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef DIRECTOR_HOST_H
 
2
#define DIRECTOR_HOST_H
 
3
 
 
4
#include "network.h"
 
5
 
 
6
struct director;
 
7
 
 
8
struct director_host {
 
9
        struct ip_addr ip;
 
10
        unsigned int port;
 
11
 
 
12
        /* name contains "ip:port" */
 
13
        char *name;
 
14
        /* change commands each have originating host and originating sequence.
 
15
           we'll keep track of the highest sequence we've seen from the host.
 
16
           if we find a lower sequence, we've already handled the command and
 
17
           it can be ignored (or: it must be ignored to avoid potential command
 
18
           loops) */
 
19
        unsigned int last_seq;
 
20
        /* Last time host was detected to be down/broken */
 
21
        time_t last_failed;
 
22
        /* we are this director */
 
23
        unsigned int self:1;
 
24
};
 
25
 
 
26
struct director_host *
 
27
director_host_add(struct director *dir, const struct ip_addr *ip,
 
28
                  unsigned int port);
 
29
void director_host_free(struct director_host *host);
 
30
 
 
31
struct director_host *
 
32
director_host_get(struct director *dir, const struct ip_addr *ip,
 
33
                  unsigned int port);
 
34
struct director_host *
 
35
director_host_lookup(struct director *dir, const struct ip_addr *ip,
 
36
                     unsigned int port);
 
37
struct director_host *
 
38
director_host_lookup_ip(struct director *dir, const struct ip_addr *ip);
 
39
 
 
40
/* Returns 0 if b1 equals b2.
 
41
   -1 if b1 is closer to our left side than b2 or
 
42
   -1 if b2 is closer to our right side than b1
 
43
   1 vice versa */
 
44
int director_host_cmp_to_self(const struct director_host *b1,
 
45
                              const struct director_host *b2,
 
46
                              const struct director_host *self);
 
47
 
 
48
/* Parse hosts list (e.g. "host1:port host2 host3:port") and them as
 
49
   directors */
 
50
void director_host_add_from_string(struct director *dir, const char *hosts);
 
51
 
 
52
#endif