Stap 3: Instellen van DHCDETECT
importeren uit isc_dhcp_leases.iscdhcpleases IscDhcpLeases
leasepath = ' / var/insecure.lease'
def detect(oldlist): "" ":
rtype: tupel van lijsten "" "
checkthese =]
tmplist =]
leasefile = IscDhcpLeases(leasepath)
leaselist = leasefile.get()
voor lease in leaselist:
als lease.valid:
tmplist.Append(lease.id)
als lease.ip in oldlist: # TODO: beslissen over dingen
blijven
checkthese.Append(lease.IP)
lostlist = list(set(oldlist) - set(tmplist))
terugkeer (tmplist, checkthese, lostlist)