~ubuntu-branches/ubuntu/vivid/keepalived/vivid

« back to all changes in this revision

Viewing changes to keepalived/include/check_api.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2011-10-25 16:10:58 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20111025161058-bgqn5elt0xo1tq0a
Tags: 1:1.2.2-1ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - debian/rules: DEB_UPDATE_RCD_PARAMS := explicit init start/stop
    parameters (don't stop at 0 and 6)
  - debian/init.d: init script header adapted to stop rule
  - debian/keepalived.postinst: Remove shutdown and reboot links
* Build with libnl3, thanks to a patch from Marc - A. Dahlhaus.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *              as published by the Free Software Foundation; either version
18
18
 *              2 of the License, or (at your option) any later version.
19
19
 *
20
 
 * Copyright (C) 2001-2010 Alexandre Cassen, <acassen@freebox.fr>
 
20
 * Copyright (C) 2001-2011 Alexandre Cassen, <acassen@linux-vs.org>
21
21
 */
22
22
 
23
23
#ifndef _CHECK_API_H
38
38
        void *data;
39
39
        checker_id_t id;        /* Checker identifier */
40
40
        int enabled;            /* Activation flag */
41
 
} checker;
 
41
} checker_t;
42
42
 
43
43
/* Checkers queue */
44
44
extern list checkers_queue;
45
45
 
46
46
/* utility macro */
47
47
#define CHECKER_ARG(X) ((X)->data)
48
 
#define CHECKER_DATA(X) (((checker *)X)->data)
 
48
#define CHECKER_DATA(X) (((checker_t *)X)->data)
49
49
#define CHECKER_GET() (CHECKER_DATA(LIST_TAIL_DATA(checkers_queue)))
50
50
#define CHECKER_VALUE_INT(X) (atoi(VECTOR_SLOT(X,1)))
51
51
#define CHECKER_VALUE_STRING(X) (set_value(X))
52
 
#define CHECKER_VIP(C)   (SVR_IP((C)->vs))
53
 
#define CHECKER_VPORT(C) (SVR_PORT((C)->vs))
54
 
#define CHECKER_RIP(C)   (SVR_IP((C)->rs))
55
 
#define CHECKER_RPORT(C) (SVR_PORT((C)->rs))
56
52
#define CHECKER_VHOST(C) (VHOST((C)->vs))
57
53
#define CHECKER_ENABLED(C) ((C)->enabled)
58
54
#define CHECKER_ENABLE(C)  ((C)->enabled = 1)
62
58
/* Prototypes definition */
63
59
extern void init_checkers_queue(void);
64
60
extern void queue_checker(void (*free_func) (void *), void (*dump_func) (void *)
65
 
                          , int (*launch) (struct _thread *)
66
 
                          , void *data);
 
61
                          , int (*launch) (thread_t *)
 
62
                          , void *);
67
63
extern void dump_checkers_queue(void);
68
64
extern void free_checkers_queue(void);
69
65
extern void register_checkers_thread(void);
70
66
extern void install_checkers_keyword(void);
71
 
extern void update_checker_activity(uint32_t address, int enable);
 
67
extern void update_checker_activity(sa_family_t, void *, int);
 
68
extern void checker_set_dst(struct sockaddr_storage *);
 
69
extern void checker_set_dst_port(struct sockaddr_storage *, uint16_t);
72
70
 
73
71
#endif