MCPcopy Index your code
hub / github.com/secdev/scapy / get_if_bcast

Method get_if_bcast

scapy/route.py:230–247  ·  view source on GitHub ↗

Return the list of broadcast addresses of an interface.

(self, iff)

Source from the content-addressed store, hash-verified

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
250conf.route = Route()

Callers 2

getmacbyipFunction · 0.80
nbns_resolveFunction · 0.80

Calls 3

ltoaFunction · 0.90
warningFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected