2015-04-03 07:53:24 -04:00
|
|
|
/*
|
|
|
|
|
* include/types/session.h
|
|
|
|
|
* This file defines everything related to sessions.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2000-2015 Willy Tarreau - w@1wt.eu
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation, version 2.1
|
|
|
|
|
* exclusively.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _TYPES_SESSION_H
|
|
|
|
|
#define _TYPES_SESSION_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
|
|
#include <common/config.h>
|
|
|
|
|
#include <common/mini-clist.h>
|
|
|
|
|
|
|
|
|
|
#include <types/obj_type.h>
|
|
|
|
|
#include <types/proxy.h>
|
|
|
|
|
#include <types/stick_table.h>
|
2015-04-04 12:08:21 -04:00
|
|
|
#include <types/task.h>
|
2015-06-19 05:59:02 -04:00
|
|
|
#include <types/vars.h>
|
2015-04-03 07:53:24 -04:00
|
|
|
|
2018-11-30 11:24:55 -05:00
|
|
|
struct sess_srv_list {
|
|
|
|
|
void *target;
|
2018-12-27 11:20:54 -05:00
|
|
|
struct list conn_list; /* Head of the connections list */
|
|
|
|
|
struct list srv_list; /* Next element of the server list */
|
2018-11-30 11:24:55 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define MAX_SRV_LIST 5
|
|
|
|
|
|
2019-05-29 09:01:50 -04:00
|
|
|
/* session flags */
|
|
|
|
|
enum {
|
|
|
|
|
SESS_FL_NONE = 0x00000000, /* nothing */
|
|
|
|
|
SESS_FL_PREFER_LAST = 0x00000001, /* NTML authent, we should reuse last conn */
|
|
|
|
|
};
|
|
|
|
|
|
2015-04-03 07:53:24 -04:00
|
|
|
struct session {
|
2015-04-03 09:40:56 -04:00
|
|
|
struct proxy *fe; /* the proxy this session depends on for the client side */
|
2015-04-03 08:46:27 -04:00
|
|
|
struct listener *listener; /* the listener by which the request arrived */
|
2015-04-03 12:08:29 -04:00
|
|
|
enum obj_type *origin; /* the connection / applet which initiated this session */
|
2015-04-04 08:46:56 -04:00
|
|
|
struct timeval accept_date; /* date of the session's accept() in user date */
|
|
|
|
|
struct timeval tv_accept; /* date of the session's accept() in internal date (monotonic) */
|
2015-04-04 09:58:58 -04:00
|
|
|
struct stkctr stkctr[MAX_SESS_STKCTR]; /* stick counters for tcp-connection */
|
2015-06-19 05:59:02 -04:00
|
|
|
struct vars vars; /* list of variables for the session scope. */
|
2017-08-28 13:02:51 -04:00
|
|
|
struct task *task; /* handshake timeout processing */
|
2018-09-05 05:56:48 -04:00
|
|
|
long t_handshake; /* handshake duration, -1 = not completed */
|
2018-12-28 12:50:57 -05:00
|
|
|
int idle_conns; /* Number of connections we're currently responsible for that we are not using */
|
2018-12-27 11:20:54 -05:00
|
|
|
struct list srv_list; /* List of servers and the connections the session is currently responsible for */
|
2019-05-29 09:01:50 -04:00
|
|
|
unsigned int flags; /* session flags, SESS_FL_* */
|
2015-04-03 07:53:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* _TYPES_SESSION_H */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Local variables:
|
|
|
|
|
* c-indent-level: 8
|
|
|
|
|
* c-basic-offset: 8
|
|
|
|
|
* End:
|
|
|
|
|
*/
|