(info, interface)
return cfg
Generate configurations
Generate configurations
Generate configurations
def _gen_cfgs(info, interface):
    """Generate configurations"""
    cfg = Cfg()
    cfg.add_opt("debug", "udpnet")
    cfg.add_opt("debug", "udpmulticast")
    cfg.add_opt("udpmulticastloginterval", "600")

    if (info['setup']['type'] == defs.sdr_setup_type):
        src_addr = "127.0.0.1"
        label = "blocksat-sdr"
    elif (info['setup']['type'] == defs.linux_usb_setup_type):
        src_addr = info['sat']['ip']
        label = "blocksat-tbs"
    elif (info['setup']['type'] == defs.standalone_setup_type):
        src_addr = info['sat']['ip']
        label = "blocksat-s400"
    elif (info['setup']['type'] == defs.sat_ip_setup_type):
        src_addr = "127.0.0.1"
        label = "blocksat-sat-ip"
    else:
        raise ValueError("Unknown setup type")

    cfg.add_opt("udpmulticast",
                _udpmulticast(dev=interface, src_addr=src_addr, label=label))

    return cfg
def _gen_cfgs ( info , interface ) : cfg = Cfg ( ) cfg . add_opt ( "debug" , "udpnet" ) cfg . add_opt ( "debug" , "udpmulticast" ) cfg . add_opt ( "udpmulticastloginterval" , "600" ) if ( info [ 'setup' ] [ 'type' ] == defs . sdr_setup_type ) : src_addr = "127.0.0.1" label = "blocksat-sdr" elif ( info [ 'setup' ] [ 'type' ] == defs . linux_usb_setup_type ) : src_addr = info [ 'sat' ] [ 'ip' ] label = "blocksat-tbs" elif ( info [ 'setup' ] [ 'type' ] == defs . standalone_setup_type ) : src_addr = info [ 'sat' ] [ 'ip' ] label = "blocksat-s400" elif ( info [ 'setup' ] [ 'type' ] == defs . sat_ip_setup_type ) : src_addr = "127.0.0.1" label = "blocksat-sat-ip" else : raise ValueError ( "Unknown setup type" ) cfg . add_opt ( "udpmulticast" , _udpmulticast ( dev = interface , src_addr = src_addr , label = label ) ) return cfg