blob: 94107181ec57314d714fbf17b4f6b14709c7c5fe [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
Willy Tarreau939478d2013-12-06 21:08:11 +010033/* object types : these ones take the same space as a char */
Willy Tarreau3fdb3662012-11-12 00:42:33 +010034enum 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 */
Willy Tarreau30576452015-04-13 13:50:30 +020039 OBJ_TYPE_APPLET, /* object is a struct applet */
Willy Tarreau0788f472013-10-24 22:45:25 +020040 OBJ_TYPE_APPCTX, /* object is a struct appctx */
Willy Tarreau51c21842013-09-29 09:06:42 +020041 OBJ_TYPE_CONN, /* object is a struct connection */
Olivier Houcharde2c222b2017-08-04 18:31:56 +020042 OBJ_TYPE_SRVRQ, /* object is a struct dns_srvrq */
Olivier Houcharde2b40b92017-09-13 18:30:23 +020043 OBJ_TYPE_CS, /* object is a struct conn_stream */
Baptiste Assmann0b9ce822018-01-30 08:10:20 +010044 OBJ_TYPE_STREAM, /* object is a struct stream */
Willy Tarreau66337a02013-09-29 09:15:31 +020045 OBJ_TYPE_ENTRIES /* last one : number of entries */
Willy Tarreau939478d2013-12-06 21:08:11 +010046} __attribute__((packed)) ;
Willy Tarreau3fdb3662012-11-12 00:42:33 +010047
48#endif /* _TYPES_OBJ_TYPE_H */
49
50/*
51 * Local variables:
52 * c-indent-level: 8
53 * c-basic-offset: 8
54 * End:
55 */