anchor.diff:  get_local_port(Port) ->
       20000 + Port.
   
  -
  -%% start_proxy/3
  -%% ====================================================================
  -%% @doc Starts oneproxy in proxy mode. This function either does not return or throws exception.
  -%% @end
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Starts oneproxy in proxy mode. This function either does not return or throws exception.
  +%% @end
  +%%--------------------------------------------------------------------
   -spec start_proxy(ListenerPort :: non_neg_integer(), CertFile :: string() | binary(),
       VerifyType :: verify_peer | verify_none) -> no_return().
  -%% ====================================================================
   start_proxy(ListenerPort, CertFile, VerifyType) ->
       start("proxy", ListenerPort, [utils:ensure_list(CertFile),
           utils:ensure_list(VerifyType)]).
   
  -
  -%% start_rproxy/4
  -%% ====================================================================
  -%% @doc Starts oneproxy in reverse proxy mode with HTTP-based authentication
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Starts oneproxy in reverse proxy mode with HTTP-based authentication
   %% delegation. This function either does not return or throws exception.
   %% @end
  +%%--------------------------------------------------------------------
   -spec start_rproxy(ListenerPort :: non_neg_integer(), ForwardPort :: non_neg_integer(),
  -            CertFile :: string() | binary(), VerifyType :: verify_peer | verify_none) -> no_return().
  -%% ====================================================================
  +    CertFile :: string() | binary(), VerifyType :: verify_peer | verify_none) -> no_return().
   start_rproxy(ListenerPort, ForwardPort, CertFile, VerifyType) ->
       start_rproxy(ListenerPort, ForwardPort, CertFile, VerifyType, http).
   
  -
  -%% start_rproxy/5
  -%% ====================================================================
  -%% @doc Starts oneproxy in reverse proxy mode. This function either does not return or throws exception.
  -%% @end
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Starts oneproxy in reverse proxy mode. This function either does not return or throws exception.
  +%% @end
  +%%--------------------------------------------------------------------
   -spec start_rproxy(ListenerPort :: non_neg_integer(), ForwardPort :: non_neg_integer(),
       CertFile :: string() | binary(), VerifyType :: verify_peer | verify_none,
       Http :: http | no_http) -> no_return().
  -%% ====================================================================
   start_rproxy(ListenerPort, ForwardPort, CertFile, VerifyType, Http) ->
       start("reverse_proxy", ListenerPort, ["127.0.0.1",
           integer_to_list(ForwardPort), utils:ensure_list(CertFile),
           utils:ensure_list(VerifyType), utils:ensure_list(Http)]).
   
  -
  -%% get_der_certs_dir/0
  -%% ====================================================================
  -%% @doc Returns directory (path) used by oneproxy to save DER CAs and CRLs.
  -%% @end
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Returns directory (path) used by oneproxy to save DER CAs and CRLs.
  +%% @end
  +%%--------------------------------------------------------------------
   -spec get_der_certs_dir() -> string().
  -%% ====================================================================
   get_der_certs_dir() ->
       {ok, CertDir} = application:get_env(?APP_NAME, ca_dir),
       filename:join(CertDir, ?DER_CERTS_DIR).
   
  -
  -%% ca_crl_to_der/1
  -%% ====================================================================
  -%% @doc Save all CAs and CRLs from GSI state to given directory in DER format.
  -%% @end
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Save all CAs and CRLs from GSI state to given directory in DER format.
  +%% @end
  +%%--------------------------------------------------------------------
   -spec ca_crl_to_der(Dir :: string()) -> ok | {error, Reason :: any()}.
  -%% ====================================================================
   ca_crl_to_der(Dir) ->
       case ets:info(gsi_state) of
           undefined ->
  
positive.code:             end
      end.
  
  %% ====================================================================
  %% Internal functions
  %% ====================================================================
  
  
  %% exec/3
  %% ====================================================================
  %% @doc oneproxy port dirver's main loop.
  %% @end
  -spec exec(OneProxy :: pid() | atom(), CMD :: binary(), Args :: [binary()]) -> term().
  %% ====================================================================
  exec(OneProxy, CMD, Args) when is_atom(OneProxy) ->
  
negative.code:                         timer:send_after(500, reload_certs),
                          State
                  end;
          %% Executes given command on oneproxy and replays with {ok, Response} or {error, Reason}
              {{Pid, Id}, {command, CMD, Args}} ->
                  BinPid = base64:encode(term_to_binary(Pid)),
                  PidSize = size(BinPid),
  