]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Add remote-count and remote-entry query via management
authorSelva Nair <selva.nair@gmail.com>
Tue, 7 Sep 2021 22:31:24 +0000 (18:31 -0400)
committerGert Doering <gert@greenie.muc.de>
Tue, 27 Dec 2022 08:30:20 +0000 (09:30 +0100)
commit5503b45e6666cc7a3f10dd1e6fb406ca487489bd
tree3014bcaa6b1c1f213692e1012e3f28b014374ee8
parent5d47df8d69c73629eccc1e443b3dfedbb9e8fd2d
Add remote-count and remote-entry query via management

Selecting the remote host via the management interface
(management-query-remote) provides a restrictive user
experience as there is no easy way to tabulate all available
remote entries and show a list to the user to choose from.
Fix that.

Two new commands for querying the management interface are added:
(i) remote-entry-count : returns the number of remotes specified
    in the config file. Example result:
       10
       END

(ii) remote-entry-get i [j]: returns the remote entry at index i
     in the form index,host,port,protocol. Or, if j is present
     all entries from index i to j-1 are returned, one per line.

     Example result for i = 2:
        2,ovpn.example.com,1194,udp
        END
     Example result for i = 2, j = 4
        2,ovpn.example.com,1194,udp
        3,ovpn.example.com,443,tcp-client
        END

     remote-entry-get all: returns all remote entries.

v2: use independent callback functions for the two commands
v3: return results as 0 or more lines terminated by END, as done
    for all other similar commands. v1 was fashioned after
    pkcs11-id-count and pkcs11-id-get which uses a format not
    consistent with the rest of the management commands.

See also management-notes.txt

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20210907223126.8440-1-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22815.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 125263804701f9e62a5a27587e4ea6afdb21f54d)
Changes.rst
doc/management-notes.txt
src/openvpn/init.c
src/openvpn/manage.c
src/openvpn/manage.h