blob: cfb3e346332c2cf59875e17bd475ccbb93432b49 [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 *
5 * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
6 *
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 */
40};
41
42#endif /* _TYPES_OBJ_TYPE_H */
43
44/*
45 * Local variables:
46 * c-indent-level: 8
47 * c-basic-offset: 8
48 * End:
49 */