Ex: delt(dst="::/0") delt(dst="2001:db8:cafe:f000::/56") delt(dst="2001:db8:cafe:f000::/56", gw="2001:db8:deca::1")
(self, dst, gw=None)
| 136 | pass |
| 137 | |
| 138 | def delt(self, dst, gw=None): |
| 139 | # type: (str, Optional[str]) -> None |
| 140 | """ Ex: |
| 141 | delt(dst="::/0") |
| 142 | delt(dst="2001:db8:cafe:f000::/56") |
| 143 | delt(dst="2001:db8:cafe:f000::/56", gw="2001:db8:deca::1") |
| 144 | """ |
| 145 | tmp = dst + "/128" |
| 146 | dst, plen_b = tmp.split('/')[:2] |
| 147 | dst = in6_ptop(dst) |
| 148 | plen = int(plen_b) |
| 149 | to_del = [x for x in self.routes |
| 150 | if in6_ptop(x[0]) == dst and x[1] == plen] |
| 151 | if gw: |
| 152 | gw = in6_ptop(gw) |
| 153 | to_del = [x for x in self.routes if in6_ptop(x[2]) == gw] |
| 154 | if len(to_del) == 0: |
| 155 | warning("No matching route found") |
| 156 | elif len(to_del) > 1: |
| 157 | warning("Found more than one match. Aborting.") |
| 158 | else: |
| 159 | i = self.routes.index(to_del[0]) |
| 160 | self.invalidate_cache() |
| 161 | self.remove_ipv6_iface(self.routes[i][3]) |
| 162 | del self.routes[i] |
| 163 | |
| 164 | def ifchange(self, iff, addr): |
| 165 | # type: (str, str) -> None |
nothing calls this directly
no test coverage detected