summaryrefslogtreecommitdiff
path: root/deps/rabbit_common/include/rabbit.hrl
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2016-08-31 03:29:52 +0300
committerMichael Klishin <mklishin@pivotal.io>2016-08-31 03:29:52 +0300
commit481e16dbd720a12f185ae561dc65267bd4b31cc2 (patch)
treed60892e36bf3b7a6ddfde28abb49c55a2de27b91 /deps/rabbit_common/include/rabbit.hrl
parent506b832a47f27cf8f51282fb02179047f2a00b7f (diff)
parentf32cf1e72281d57f68f4a2f854bfca179f339b29 (diff)
downloadrabbitmq-server-git-481e16dbd720a12f185ae561dc65267bd4b31cc2.tar.gz
Merge branch 'master' into rabbitmq-server-930
Diffstat (limited to 'deps/rabbit_common/include/rabbit.hrl')
-rw-r--r--deps/rabbit_common/include/rabbit.hrl84
1 files changed, 83 insertions, 1 deletions
diff --git a/deps/rabbit_common/include/rabbit.hrl b/deps/rabbit_common/include/rabbit.hrl
index 81f735970f..a0845b0ff6 100644
--- a/deps/rabbit_common/include/rabbit.hrl
+++ b/deps/rabbit_common/include/rabbit.hrl
@@ -39,7 +39,65 @@
-record(user_vhost, {username, virtual_host}).
-record(user_permission, {user_vhost, permission}).
--record(vhost, {virtual_host, dummy}).
+%% Represents a vhost.
+%%
+%% Historically this record had 2 arguments although the 2nd
+%% was never used (`dummy`, always undefined). This is because
+%% single field records were/are illegal in OTP.
+%%
+%% As of 3.6.x, the second argument is vhost limits,
+%% which is actually used and has the same default.
+%% Nonetheless, this required a migration, see rabbit_upgrade_functions.
+-record(vhost, {
+ %% vhost name as a binary
+ virtual_host,
+ %% proplist of limits configured, if any
+ limits}).
+
+%% Client connection, used by rabbit_reader
+%% and related modules.
+-record(connection, {
+ %% e.g. <<"127.0.0.1:55054 -> 127.0.0.1:5672">>
+ name,
+ %% used for logging: same as `name`, but optionally
+ %% augmented with user-supplied name
+ log_name,
+ %% server host
+ host,
+ %% client host
+ peer_host,
+ %% server port
+ port,
+ %% client port
+ peer_port,
+ %% protocol implementation module,
+ %% e.g. rabbit_framing_amqp_0_9_1
+ protocol,
+ user,
+ %% heartbeat timeout value used, 0 means
+ %% heartbeats are disabled
+ timeout_sec,
+ %% maximum allowed frame size,
+ %% see frame_max in the AMQP 0-9-1 spec
+ frame_max,
+ %% greatest channel number allowed,
+ %% see channel_max in the AMQP 0-9-1 spec
+ channel_max,
+ vhost,
+ %% client name, version, platform, etc
+ client_properties,
+ %% what lists protocol extensions
+ %% does this client support?
+ capabilities,
+ %% authentication mechanism used
+ %% as a pair of {Name, Module}
+ auth_mechanism,
+ %% authentication mechanism state,
+ %% initialised by rabbit_auth_mechanism:init/1
+ %% implementations
+ auth_state,
+ %% time of connection
+ connected_at}).
-record(content,
{class_id,
@@ -140,6 +198,30 @@
dependency_version_requirements %% [{atom(), [string()]}]
}).
+%% used to track connections across virtual hosts
+%% so that limits can be enforced
+-record(tracked_connection_per_vhost,
+ {vhost, connection_count}).
+
+%% Used to track detailed information
+%% about connections.
+-record(tracked_connection, {
+ %% {Node, Name}
+ id,
+ node,
+ vhost,
+ name,
+ pid,
+ protocol,
+ %% client host
+ peer_host,
+ %% client port
+ peer_port,
+ username,
+ %% time of connection
+ connected_at
+ }).
+
%%----------------------------------------------------------------------------
-define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2016 Pivotal Software, Inc.").