Example #1
0
    def build_dhcpv6_reply(self, q, server, client, ias=True, T1=300, T2=300):
        p = DHCP6_Reply(trid=q.trid)/ \
                DHCP6OptServerId(duid=builder.duid(server.iface(0).ll_addr))/ \
                    DHCP6OptClientId(duid=q[DHCP6OptClientId].duid)
        if ias:
            for ia in builder.ias(q[DHCP6OptIA_NA], client, T1, T2):
                p = p / ia
        p = p / DHCP6OptPref()

        return p
Example #2
0
    def build_dhcpv6_reply(self, q, server, client, ias=True, T1=300, T2=300):
        p = DHCP6_Reply(trid=q.trid)/ \
                DHCP6OptServerId(duid=builder.duid(server.iface(0).ll_addr))/ \
                    DHCP6OptClientId(duid=q[DHCP6OptClientId].duid)
        if ias:
            for ia in builder.ias(q[DHCP6OptIA_NA], client, T1, T2):
                p = p/ia
        p = p/DHCP6OptPref()

        return p
Example #3
0
    def build_dhcpv6_advertisement(self, s, server, client, options=True, ias=True, T1=300, T2=300):
        a = DHCP6_Advertise(trid=s.trid)/ \
                DHCP6OptServerId(duid=builder.duid(server.iface(0).ll_addr))/ \
                    DHCP6OptClientId(duid=s[DHCP6OptClientId].duid)
        if options:
            for option in builder.options(s[DHCP6OptOptReq].reqopts):
                a = a/option
        if ias:
            for ia in builder.ias(s[DHCP6OptIA_NA], client, T1, T2):
                a = a/ia
        a = a/DHCP6OptPref()

        return a
Example #4
0
    def build_dhcpv6_advertisement(self,
                                   s,
                                   server,
                                   client,
                                   options=True,
                                   ias=True,
                                   T1=300,
                                   T2=300):
        a = DHCP6_Advertise(trid=s.trid)/ \
                DHCP6OptServerId(duid=builder.duid(server.iface(0).ll_addr))/ \
                    DHCP6OptClientId(duid=s[DHCP6OptClientId].duid)
        if options:
            for option in builder.options(s[DHCP6OptOptReq].reqopts):
                a = a / option
        if ias:
            for ia in builder.ias(s[DHCP6OptIA_NA], client, T1, T2):
                a = a / ia
        a = a / DHCP6OptPref()

        return a