Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for additional protocol commands (for GS30x series) #35

Open
wants to merge 41 commits into
base: master
Choose a base branch
from

Conversation

rhulme
Copy link

@rhulme rhulme commented Mar 20, 2021

No description provided.

Newer switches reply directly to the client rather than via broadcast.
This ensures the sequence counter is always incremental even if
building a sequence requires querying other information first.
Some work still needs to be done on the payload handling.
Sometimes there's just payload starting with the length (no cmd field),
sometimes the payload is as normal and includes the cmd field.
Data returned is speed and flow control status of each port
This allows the maximum speed and flow control to be set/queried
The second parameter contains all the ports that should be part of the VLAN.
The third parameter contains which of those ports are tagged.
This makes it easier to use the ProSafeLinux class from other code and
perform additional error handling as required.
First byte always seems to 1
The next thirteen bytes are the serial number in ASCII
Then zero byte (null-terminator perhaps?)
Then six unknown bytes - different from one switch to another but consistent within one switch
This allows settings on a per-port or per-vlan basis to be set in
one go rather than having to call the program multiple times.
hamarituc and others added 9 commits June 26, 2022 17:21
Multi-value options usually make a change to a single port or VLAN so
it makes sense to allow them to be specified multiple times so that
multiple ports or VLANs can be specified in a single call.

Without this fix, the program will crash if only a single multi-value
option is passed
This mainly affects older version of Python that don't have ordered dicts
by default.
Some commands (VLAN, 802.1q, port mirroring) use a bitmap to represent
affected ports.  The length of the data will therefore vary as a 16-port
switch will require two bytes (16 bits).  Until now the code assumed
1 byte per parameter (i.e. up to 8 ports)

Parsing queried data is not too difficult as the code can work out the
length of each parameter based on the length of the received data.

Setting data is trickier as the command has to know how many ports the
switch supports but the code was written to be stateless.

If one of the affected commands is detected (for setting), the number
of ports is first queried and then passed on to all the affected
commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants