Coder Social home page Coder Social logo

Comments (2)

PropGit avatar PropGit commented on July 17, 2024

As it relates to Issue #94, a history list will be used to retain the original Name (as well as IP and MAC) of a wireless port and will contain also a UID and Life field used by this issue to form a more stable and unique list of wireless port identifiers.

The process of making a new entry unique is as follows:

  • Compare new item's MAC against the MAC of all items in history list
  • If a MAC match is found:
    • Compare Names
      • If they match, simply set Life to 4
      • If they don't match, remove entry and treat as a new non-MAC match item (below)
  • If no MAC match is found:
    • Search list for matching Name
      • If no Name match found:
        • Create new entry with Name, IP, MAC, UID=Name, and Life = 4
      • If a Name match found:
        • Repeat Name search for Name=Name+'-#' where # is progressively more right-most MAC digits until no Name match is found (or it's used all possible MAC digits), then create new entry with Name, IP, MAC, a UID (from Name mangling above), and a Life = 4

Return Wi-Fi Identifier list as a sorted list of UID values appended to the wired ports list.

NOTE: Issue #94 describes the trimming of the history list; an important part where the Life field comes into play.

from blocklypropclient.

PropGit avatar PropGit commented on July 17, 2024

Solved and merged via PR #96!

The official process of generating a port list (including features of Issue #86 and Issue #94) is:
wiredMaxLife is 2
wirelessMaxLife is 4
portRec is a list containing fields UID, Name, IP, MAC, and Life

  • Retrieve list of wired and wireless ports from PropLoader
    • For each port
      • Is it a wired port?
        • If wired port identifier matches an existing UID from the portRec (history list)
          • Reset matching portRec's Life field to wiredMaxLife
        • Else (no wired port match)
          • Create new portRec entry (wired_port_identifier, n/a, n/a, n/a, wiredMaxLife)
      • Else (wireless port)
        • If wireless port's MAC does not match an existing MAC from the portRec (history list)
          • Create new portRec entry (UID=Unique_Name, Name, IP, MAC, wirelessMaxLife)
        • Else (found MAC match)
          • If Name hasn't changed
            • Update portRec's matching entry to IP and wirelessMaxLife
          • Else (Name has changed)
            • Delete old portRec entry
            • Create new portRec entry (UID=Unique_Name, Name, IP, MAC, wirelessMaxLife)
    • Age records (subtract 1 from Life filed)
    • Remove ancients (delete records with Life = 0)

Return Wi-Fi Identifier list as a sorted list of UID values appended to the wired ports list.

For each "Create new portRec entry..." step:
MAC = entry's MAC address stripped of colons (:)
UID = Name
Size = 1

  • while UID matches a UID in portRec
    • Set UID to Name + Size rightmost characters from MAC
    • Increment Size
    • If Size = length MAC
      • Prep to repeat MAC further
        • Name = UID
        • Size = 1
  • Create new portRec entry (UID, Name, IP, actual_MAC, wirelessMaxLife)

from blocklypropclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.