diff options
author | Anders Svensson <[email protected]> | 2016-05-09 16:13:24 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2016-05-09 16:13:24 +0200 |
commit | f46d8a7f862a3f634b16c90426cb8601001c9de4 (patch) | |
tree | 2ddcec874fcd2fcab770f742b8b21ce12279cf37 /lib/diameter/src/base/diameter_service.erl | |
parent | a3f49cfc599bc3edda886cc6e895b442506ee6cc (diff) | |
parent | 18449b6bd35be4ad66ea7874a397029c8c920629 (diff) | |
download | otp-f46d8a7f862a3f634b16c90426cb8601001c9de4.tar.gz otp-f46d8a7f862a3f634b16c90426cb8601001c9de4.tar.bz2 otp-f46d8a7f862a3f634b16c90426cb8601001c9de4.zip |
Merge branch 'anders/diameter/info/OTP-13508'
* anders/diameter/info/OTP-13508:
Add diameter:peer_find/1
Add diameter:peer_info/1
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index efa4cc9108..cfb5cb5b82 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -32,6 +32,7 @@ -export([subscribe/1, unsubscribe/1, services/0, + peer_info/1, info/2]). %% towards diameter_config @@ -218,6 +219,29 @@ lookup_state(SvcName) -> end. %% --------------------------------------------------------------------------- +%% # peer_info/2 +%% --------------------------------------------------------------------------- + +%% An extended version of info_peer/1 for peer_info/1. +peer_info(Pid) -> + try + {_, PD} = process_info(Pid, dictionary), + {_, T} = lists:keyfind({diameter_peer_fsm, start}, 1, PD), + {TPid, {{Type, Ref}, TMod, Cfg}} = T, + {_, TD} = process_info(TPid, dictionary), + {_, Data} = lists:keyfind({TMod, info}, 1, TD), + [{ref, Ref}, + {type, Type}, + {owner, TPid}, + {module, TMod}, + {config, Cfg} + | try TMod:info(Data) catch _:_ -> [] end] + catch + error:_ -> + [] + end. + +%% --------------------------------------------------------------------------- %% # subscribe/1 %% # unsubscribe/1 %% --------------------------------------------------------------------------- |