]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r345843:
authorAndrey V. Elsukov <ae@FreeBSD.org>
Wed, 1 May 2019 09:05:48 +0000 (09:05 +0000)
committerAndrey V. Elsukov <ae@FreeBSD.org>
Wed, 1 May 2019 09:05:48 +0000 (09:05 +0000)
commit4da84a5bb3c9969a589fa60e63338461254a86f3
treebe76d838122c4d2c6288190a41904a40db57c492
parent875574a7303b5b173a7ca51521670c53c4188461
MFC r345843:
  Follow the declared behaviour that specifies server string format in
  bsnmpclient(3).

  snmp_parse_server() function accepts string where some fields can be
  omitted: [trans::][community@][server][:port]

  "trans" field can be "udp", "udp6", "dgram" and "stream".
  "community" can be empty string, if it is omitted, the default value
  will be used. For read_community it is "public", for write_comminity
  it is "private". "server" field can be hostname, IPv4 address or IPv6
  address. IPv6 address should be specified in brackets "[]".
  If port is omitted, the default value "snmp" will be used for "udp"
  and "udp6" transports. So, now for bsnmpget(1) and bsnmwalk(1) it is
  not required to specify all fields in argument of '-s' option. E.g.

    # bsnmpget -s 127.1 sysName.0
    # bsnmpget -s "udp::127.1" sysName.0
    # bsnmpget -s "udp::public@127.1" sysName.0
    # bsnmpget -s "udp::public@127.1:161" sysName.0
    # bsnmpget -s "udp::[::1]" sysName.0
    # bsnmpget -s "udp6::[::1]" sysName.0
    # bsnmpget -s "[fe80::1%lo0]" sysName.0

  PR: 236664
  Reported by: olivier
contrib/bsnmp/lib/snmpclient.c