Ejemplo n.º 1
0
 def __addIpDetails(self):
     port = self.__port
     ip_layer = IP()
     ip_layer.src = port.ip_src
     ip_layer.dst = port.ip_dst
     #ip_layer.id  = self._sn_handler.getNextIpId()
     #ip_layer.prot = 0x17
     self.__packet = self.__packet/ip_layer
Ejemplo n.º 2
0
    def __addIpDetails(self):
        port = self.__port
        ip_layer = IP()
        ip_layer.src = port.ip_src if hasattr(port, 'ip_src') else \
            get("TE_IP")

        if hasattr(port, 'dest_ip'):
            port.ip_dst = port.dest_ip
        elif port.ip_dst in ('', None):
            port.ip_dst = get("TR_IP")

        ip_layer.dst = port.ip_dst
        ip_layer.id  = self._sn_handler.nextIpId()
        ip_layer.ttl = 1
        #ip_layer.prot = 0x17
        self.__packet = self.__packet/ip_layer