blob: 88d897358b94a64dae7f9cd08bc4e24cb79368d2 [file] [log] [blame]
Willy Tarreau3fdb3662012-11-12 00:42:33 +01001/*
2 * include/types/obj_type.h
3 * This file declares some object types for use in various structures.
4 *
Willy Tarreau66337a02013-09-29 09:15:31 +02005 * Copyright (C) 2000-2013 Willy Tarreau - w@1wt.eu
Willy Tarreau3fdb3662012-11-12 00:42:33 +01006 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation, version 2.1
10 * exclusively.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef _TYPES_OBJ_TYPE_H
23#define _TYPES_OBJ_TYPE_H
24
25/* The principle is to be able to change the type of a pointer by pointing
26 * it directly to an object type. The object type indicates the format of the
27 * structure holing the type, and this is used to retrieve the pointer to the
28 * beginning of the structure. Doing so saves us from having to maintain both
29 * a pointer and a type for elements such as connections which can point to
30 * various types of objects.
31 */
32
33/* object types */
34enum obj_type {
35 OBJ_TYPE_NONE = 0, /* pointer is NULL by definition */
36 OBJ_TYPE_LISTENER, /* object is a struct listener */
37 OBJ_TYPE_PROXY, /* object is a struct proxy */
38 OBJ_TYPE_SERVER, /* object is a struct server */
39 OBJ_TYPE_APPLET, /* object is a struct si_applet */
Willy Tarreau51c21842013-09-29 09:06:42 +020040 OBJ_TYPE_CONN, /* object is a struct connection */
Willy Tarreau66337a02013-09-29 09:15:31 +020041 OBJ_TYPE_ENTRIES /* last one : number of entries */
Willy Tarreau3fdb3662012-11-12 00:42:33 +010042};
43
44#endif /* _TYPES_OBJ_TYPE_H */
45
46/*
47 * Local variables:
48 * c-indent-level: 8
49 * c-basic-offset: 8
50 * End:
51 */