Skip to content
Snippets Groups Projects
  1. Jul 29, 2016
    • Adam Wujek's avatar
      lib/snmp: add snmp objects · ede0d181
      Adam Wujek authored
      
      add:
      --oid_wrsPtpServoState
      --oid_wrsPtpServoStateN
      --oid_wrsPtpClockOffsetPsHR
      --oid_wrsPtpSkew
      --oid_wrpcPtpRTTHR
      --oid_wrpcPtpDeltaMs
      --oid_wrpcPtpCurSetpoint
      
      Signed-off-by: default avatarAdam Wujek <adam.wujek@cern.ch>
      ede0d181
    • Adam Wujek's avatar
      lib/snmp: add function saturating the int value · 3b8fd039
      Adam Wujek authored
      
      Used to convert 64bit to 32bit. It is better to saturate 32bit during
      conversion than just passing 32 LSB bits.
      
      Signed-off-by: default avatarAdam Wujek <adam.wujek@cern.ch>
      3b8fd039
    • Adam Wujek's avatar
      lib/snmp: add support for ASN_OCTET_STR · 47608fde
      Adam Wujek authored
      
      Signed-off-by: default avatarAdam Wujek <adam.wujek@cern.ch>
      47608fde
    • 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: default avatarAdam Wujek <adam.wujek@cern.ch>
      186cc157
    • Adam Wujek's avatar
      lib/snmp: add function printing OID · f2773135
      Adam Wujek authored
      
      Signed-off-by: default 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: default 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: default avatarAdam Wujek <adam.wujek@cern.ch>
      3f6bbea0
    • Alessandro Rubini's avatar
      net: mini snmp v1 implementation · 5feff0eb
      Alessandro Rubini authored and Adam Wujek's avatar Adam Wujek committed
      
      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: default avatarAlessandro Rubini <rubini@gnudd.com>
      5feff0eb
    • Alessandro Rubini's avatar
      util: add the perverse SNMP 'string' time format · 0e611221
      Alessandro Rubini authored and Adam Wujek's avatar Adam Wujek committed
      
      /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: default avatarAlessandro Rubini <rubini@gnudd.com>
      0e611221
  2. Jun 10, 2016
  3. May 20, 2016
    • Alessandro Rubini's avatar
    • Alessandro Rubini's avatar
    • Alessandro Rubini's avatar
      net: trivial simplifcations related to previous commit · f3ae88b3
      Alessandro Rubini authored
      
      (one is just a comment update: most of that stanza was not true any more)
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      f3ae88b3
    • Alessandro Rubini's avatar
      net: ignore macaddress in matching received frames · 7f668484
      Alessandro Rubini authored
      
      A WR socket registers using a specific mac address and the receiving code
      uses the mac address to match the frame.  This is going to be a problem
      with the new PTP code, as pdelay frames use a different mcast mac address.
      Moreover, if we go to UDP, stuff gets worse.
      
      Packet filter rules are already in place for the new mac addresses, and
      we now need to relax the checking in the software stack.
      
      As a side effect, we avoid a number of broadcast frames, because wrpc-sw
      now replies to unicast ARP requests.
      
      What happened before:
      
         16:27:07 00:0b:ab:7c:8e:4a > 00:26:7b:00:04:18 who-has ...107 tell ...200
         16:27:08 00:0b:ab:7c:8e:4a > 00:26:7b:00:04:18 who-has ...107 tell ...200
         16:27:09 00:0b:ab:7c:8e:4a > 00:26:7b:00:04:18 who-has ...107 tell ...200
         16:27:12 00:0b:ab:7c:8e:4a > ff:ff:ff:ff:ff:ff who-has ...107 tell ...200
         16:27:12 00:26:7b:00:04:18 > 00:0b:ab:7c:8e:4a ...107 is-at 00:26:7b:00:04:18
      
      what happens now:
      
         16:42:27 00:0b:ab:7c:8e:4a > 00:26:7b:00:04:18 who-has ...107 tell ...200
         16:42:27 00:26:7b:00:04:18 > 00:0b:ab:7c:8e:4a ...107 is-at 00:26:7b:00:04:18
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      7f668484
    • Alessandro Rubini's avatar
      lib/latency: changes to the better · 965efd02
      Alessandro Rubini authored
      
      This is incompatible with the previous implementation
      
       - sequence number is 32 bits
       - frames are 1,2,3 not 0,1,2 (so to be *more* incompatible)
       - no fake latency values are printed if frames are lost
       - the message is one line instead of two, and cleaner too
       - the sender reminds it's sending every 10s.
      
      The receiver's messages now include the sequence number, so we can
      match different receivers on a network.  Also, The sender's message
      report both TAI and sequence, so we can related frames to the time of
      day.
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      965efd02
  4. May 18, 2016
  5. Apr 04, 2016
  6. Feb 16, 2016
  7. Feb 15, 2016