Return the list of broadcast addresses of an interface.
(self, iff)
| 228 | return ret |
| 229 | |
| 230 | def get_if_bcast(self, iff): |
| 231 | # type: (str) -> List[str] |
| 232 | """ |
| 233 | Return the list of broadcast addresses of an interface. |
| 234 | """ |
| 235 | bcast_list = [] |
| 236 | for net, msk, _, iface, _, _ in self.routes: |
| 237 | if net == 0: |
| 238 | continue # Ignore default route "0.0.0.0" |
| 239 | elif msk == 0xffffffff: |
| 240 | continue # Ignore host-specific routes |
| 241 | if iff != iface: |
| 242 | continue |
| 243 | bcast = net | (~msk & 0xffffffff) |
| 244 | bcast_list.append(ltoa(bcast)) |
| 245 | if not bcast_list: |
| 246 | warning("No broadcast address found for iface %s\n", iff) |
| 247 | return bcast_list |
| 248 | |
| 249 | |
| 250 | conf.route = Route() |
no test coverage detected