We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For IPv6 User PD: - Increment with "next" as usual. -Decrement by recreating iterator object and calling it (current count -1) times.
``` # ... v6upd_obj = next(self.v6upd_gen) # Initial User PD creation self.updcount = 0 # ... # Increment / decrement User PD match pdchg: case 'next': # <-- for incrementing if self.psidstr == self.pslen * '1': # if all ones: self.psdistr = self.pslen * '0'. # roll over to all zeroes else: self.psidstr = bin(int(self.psidstr, 2) + 1)[2:].zfill(self.pslen) v6upd_obj = next(self.v6upd_gen) # get "next" from upd generator object v6upd_netadr = v6upd_obj.network_address v6updbin = f'{v6upd_netadr:b}' v6upd_adr = v6upd_obj.with_prefixlen self.updcount += 1 # print(f'Maximum reached, PSID starts over: {self.psidstr}') # test message case 'previous': # for decrementing if self.updcount > 0: # <-- if '1' in self.psidstr (but not all '1's): self.psidstr = bin(int(self.psidstr, 2) -1)[2:].zfill(self.pslen) self.v6upd_gen = self.bmrv6p_obj.subnets(new_prefix = self.v6updlen) # <-- re-create upd generator for _ in range(self.updcount): # <-- range should be 1 less than current count (range starts at 0) v6upd_obj = next(self.v6upd_gen) # <-- call "next" upd (updcount - 1) times self.updcount -= 1 v6upd_netadr = v6upd_obj.network_address v6updbin = f'{v6upd_netadr:b}' v6upd_adr = v6upd_obj.with_prefixlen else: # print(f'Minimum reached, no change, self.psidstr is: {self.psidstr}') # test message case _: pass # Not needed? Consider error message
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For IPv6 User PD:
- Increment with "next" as usual.
-Decrement by recreating iterator object and calling it (current count -1) times.
The text was updated successfully, but these errors were encountered: