1. 29 Jul, 2016 7 commits
    • Adam Wujek's avatar
      lib/snmp: partial implementation of SNMP_GET_NEXT · 186cc157
      Adam Wujek authored
      snmp_get_next works only when requesting oid is valid. Otherwise it fails to
      find next entry.
      
      Due to the above the snmpwalk works only when the walk is started from
      the existing oid. Since snmp walk scans only oids in the current branch,
      there was a need to create a special oid .1.3.
      
      $ snmpwalk -On -c public -v 1 192.168.1.20 1.3
      .1.3.6.1.2.1.1.5.0 = STRING: "wrc"
      .1.3.6.1.2.1.25.1.1.0 = Timeticks: (792773) 2:12:07.73
      .1.3.6.1.2.1.25.1.2.0 = Hex-STRING: 07 B2 00 01 05 00 00 00
      .1.3.6.1.4.1.96.100.7.5.1.15.1 = Counter32: 445
      .1.3.6.1.4.1.96.100.7.5.1.16.1 = INTEGER: 10
      .1.3.6.1.4.1.96.100.7.5.1.17.1 = INTEGER: 174810
      .1.3.6.1.4.1.96.100.7.5.1.18.1 = INTEGER: 191115
      .1.3.6.1.4.1.96.100.7.5.1.19.1 = INTEGER: 157655
      Timeout: No Response from 192.168.1.20
      
      NOTE: Timeout message appears becasue there is no responce from node when
      wrong packet is sent.
      Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
      186cc157
    • Adam Wujek's avatar
      lib/snmp: add function printing OID · f2773135
      Adam Wujek authored
      Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
      f2773135
    • Adam Wujek's avatar
      Kconfig: add SNMP_VERBOSE · f451742e
      Adam Wujek authored
      Move SNMP just after syslog.
      Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
      f451742e
    • Adam Wujek's avatar
      lib/snmp: add code to make adding new oid easier · 3f6bbea0
      Adam Wujek authored
      --add defines of ASN types
      --add 5 object from wrsPtpTable
      Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
      3f6bbea0
    • Alessandro Rubini's avatar
      net: mini snmp v1 implementation · 5feff0eb
      Alessandro Rubini authored
      The "community" string is public. We have tree items only: the host
      name, the date and uptime.
      
      The code is designed to make it simple any addition. But we only have
      snmpget support, not snmpwak (i.e. "get next" query).
      
      This is run on an host build (CONFIG_HOST_PROCESS) where the time and
      date are not related to the real world:
      
         # snmpget -v 1 -c public 192.168.16.1 .1.3.6.1.2.1.1.5.0
         SNMPv2-MIB::sysName.0 = STRING: wrc
         # snmpget -v 1 -c public 192.168.16.1 .1.3.6.1.2.1.25.1.2.0
         HOST-RESOURCES-MIB::hrSystemDate.0 = STRING: 1970-0-1,19:52:34.0
         # snmpget -v 1 -c public 192.168.16.1 .1.3.6.1.2.1.25.1.2.0
         HOST-RESOURCES-MIB::hrSystemDate.0 = STRING: 1970-0-1,19:53:2.0
         # snmpget -v 1 -c public 192.168.16.1 .1.3.6.1.2.1.25.1.1.0
         [...] hrSystemUptime.0 = Timeticks: (94193300) 10 days, 21:38:53.00
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      5feff0eb
    • Alessandro Rubini's avatar
      util: add the perverse SNMP 'string' time format · 0e611221
      Alessandro Rubini authored
      /var/lib/mibs/ietf/SNMPv2-TC
      
      DateAndTime ::= TEXTUAL-CONVENTION
          DISPLAY-HINT "2d-1d-1d,1d:1d:1d.1d,1a1d:1d"
          STATUS       current
          DESCRIPTION
                  "A date-time specification.
      
                  field  octets  contents                  range
                  -----  ------  --------                  -----
                    1      1-2   year*                     0..65536
                    2       3    month                     1..12
                    3       4    day                       1..31
                    4       5    hour                      0..23
                    5       6    minutes                   0..59
                    6       7    seconds                   0..60
                                 (use 60 for leap-second)
                    7       8    deci-seconds              0..9
                    8       9    direction from UTC        '+' / '-'
                    9      10    hours from UTC*           0..13
                   10      11    minutes from UTC          0..59
      
                  * Notes:
                  - the value of year is in network-byte order
                  - daylight saving time in New Zealand is +13
      
                  For example, Tuesday May 26, 1992 at 1:30:15 PM EDT would be
                  displayed as:
      
                                   1992-5-26,13:30:15.0,-4:0
      
                  Note that if only local time is known, then timezone
                  information (fields 8-10) is not present."
          SYNTAX       OCTET STRING (SIZE (8 | 11))
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      0e611221
    • Adam Wujek's avatar
      Merge branch 'adam-sfp' · d0595f5c
      Adam Wujek authored
      Improve sfp handling
      Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
      d0595f5c
  2. 10 Jun, 2016 18 commits
  3. 06 Jun, 2016 1 commit
    • Adam Wujek's avatar
      softpll: move stats defines to new file softpll_export.h · c2f15675
      Adam Wujek authored
      For other parties using the stats interface with the softpll we need
      the minimal file that can be easily used in other projects (like SNMP on
      the wr-switch).
      
      Move to the softpll_export.h:
      --struct spll_stats
      --defines of seq_state from softpll_ng.c (SEQ_* and AUX_*)
      --defines of align_state from spll_external.c (ALIGN_*)
      --defines of mode from softpll_ng.h (SPLL_MODE_*)
      Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
      c2f15675
  4. 20 May, 2016 10 commits
  5. 18 May, 2016 4 commits
    • Alessandro Rubini's avatar
      lib/latency: a latency-test engine, to check WR networks · 3edcad86
      Alessandro Rubini authored
      This adds a tool to check the latency in the network. It is selected
      at build time (config) time.  If you select CONFIG_LATENCY_PROBE you
      are then asked for a CONFIG_LATENCY_ETHTYPE.
      
      The sender node sends three frames, as broadcast in that ethertype
      within the current vlan (or no vlan).  The first frame is at priority
      7, the second at priority 6, and the third includes the egress
      timestamps for the former ones. Each group has a sequence number
      and group identifier.
      
      If the tool is built in wrc.bin, every node acts as a receiver. To
      enable a sender issuing the set of frames every 5 seconds, use "ltest 5".
      To disable use "ltest 0".
      
      The receiver prints the measured latency, and warns if it receives
      frames that are not in the proper order, using the sequence and frame
      type fields.
      
      This is a successful run crossing two wr switches:
      
          latency prio7: 5142.775
          latency prio6: 4998.775
          latency prio7: 4822.773
          latency prio6: 5142.773
          latency prio7: 5142.771
          latency prio6: 5286.771
      
      Later on, we'll make the thing less verbose, and we'll have threshold
      to signal a problem if the network went slow. Currently we just print
      all collected data.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      3edcad86
    • Alessandro Rubini's avatar
    • Alessandro Rubini's avatar
      network: prepare for network latency tests · c0a76804
      Alessandro Rubini authored
      This commit adds the Kconfig mechanism and the pfilter rules.
      
      The latency test socket transmists frames of a specific ether type;
      the receiver must receive all such frames.  To minimize the load on the
      packet filter, this adds a single rule: we already accept all PTPv2
      frames, so we now "OR" to this the new ethernet type.   If the feature
      is configured off, the rule uses the same PTPv2 ethertye, thus
      turning in practice into a NOP.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      c0a76804
    • Alessandro Rubini's avatar
      net: add priority in the wr_socket · 1b9a2bf4
      Alessandro Rubini authored
      This is used by the latency measurement, to send high-priority frames
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      1b9a2bf4