Skip to content

Commit

Permalink
Use explicit manual sequester to avoid auto sequestering under normal… (
Browse files Browse the repository at this point in the history
#346)

* Replace master with promary in comments

* Use explicit manual sequester to avoid auto sequestering under normal operation.

* Use safe_load instead of load

* Fix yaml version

Co-authored-by: Anurag Porripireddi <[email protected]>
  • Loading branch information
henry54809 and anurag6 authored Oct 19, 2021
1 parent 9f0464c commit e340a60
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions forch/port_state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PortStateMachine:
PortBehavior.Behavior: {
PortBehavior.Behavior.cleared: OPERATIONAL,
PortBehavior.Behavior.deauthenticated: UNAUTHENTICATED,
PortBehavior.Behavior.sequestered: SEQUESTERED
PortBehavior.Behavior.manual_sequestered: SEQUESTERED
}
},
}
Expand Down Expand Up @@ -377,7 +377,7 @@ def _handle_scheduled_sequstering(self, mac):
del self._scheduled_sequester_timer[mac]
self._logger.info('Handle scheduled sequester for device %s.', mac)
if mac in self._state_machines:
self._state_machines[mac].handle_port_behavior(PortBehavior.sequestered)
self._state_machines[mac].handle_port_behavior(PortBehavior.manual_sequestered)

def _handle_sequestering_timeout(self, mac):
if mac in self._sequester_timer:
Expand Down
24 changes: 14 additions & 10 deletions forch/proto/shared_constants_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions proto/shared_constants.proto
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ message PortBehavior {

// deauthenticated
deauthenticated = 6;

// Manual sequestered
manual_sequestered = 7;
}

enum PortState {
Expand Down
2 changes: 1 addition & 1 deletion public/protos.hash
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ de40904bfd80b5063478058caecc1ffa0ee6ebe3 proto/forch_configuration.proto
83e8f50c6a8b53bc2c65d98c5b0f2fe45ad6adbc proto/network_metric_state.proto
db4d1bf4d1b4ac1a575853833ecbd9571d784203 proto/path_node.proto
255a8c039f0487faa2632df22efff854285c6297 proto/process_state.proto
36ab66f7c688822694a9abb0fb1588e6f5bd0f3f proto/shared_constants.proto
0f632f51f6e314c991b0738f5d51ab1c24994d92 proto/shared_constants.proto
f2907589bfb18d4b1622b9d658899c11b56d3b86 proto/switch_state.proto
989e22bfd0863f9171eebc728658c6926ce420ef proto/system_state.proto
6 changes: 6 additions & 0 deletions public/protos.html
Original file line number Diff line number Diff line change
Expand Up @@ -5988,6 +5988,12 @@ <h3 id="PortBehavior.Behavior">PortBehavior.Behavior</h3>
<td><p>deauthenticated</p></td>
</tr>

<tr>
<td>manual_sequestered</td>
<td>7</td>
<td><p>Manual sequestered</p></td>
</tr>

</tbody>
</table>

Expand Down

0 comments on commit e340a60

Please sign in to comment.