Esempio n. 1
0
def create (scope) :
    FFM = scope.FFM
    PAP = scope.PAP
    Adr = FFM.IP4_Network.net_address.P_Type
    mgr = PAP.Person \
        (first_name = 'Ralf', last_name = 'Schlatterbeck', raw = True)
    node1 = FFM.Node (name = "nogps", manager = mgr, raw = True)
    gps1 = dict (lat = "48 d 15 m", lon = "15 d 52 m 27.84 s")
    node2 = FFM.Node \
        (name = "node2", manager = mgr, position = gps1, raw = True)
    net = FFM.IP4_Network ('192.168.23.0/24', raw = True)
    a1  = net.reserve ('192.168.23.1/32')
    a2  = net.reserve (Adr ('192.168.23.2/32'))
    a3  = net.reserve ('192.168.23.3/32')
    a4  = net.reserve (Adr ('192.168.23.4/32'))
    devtype = FFM.Net_Device_Type.instance_or_new \
        (name = 'Generic', raw = True)
    dev = FFM.Net_Device \
        (left = devtype, node = node2, name = 'dev', raw = True)
    wr  = FFM.Wired_Interface (left = dev, name = 'wr', raw = True)
    wl  = FFM.Wireless_Interface (left = dev, name = 'wl', raw = True)
    ir1 = FFM.Net_Interface_in_IP4_Network (wr, a1, mask_len = 24)
    il1 = FFM.Net_Interface_in_IP4_Network (wl, a2, mask_len = 32)
    ir2 = FFM.Net_Interface_in_IP4_Network (wr, a3, mask_len = 24)
    il2 = FFM.Net_Interface_in_IP4_Network (wl, a4, mask_len = 24)