

@classmethod
def newRoute(cls):
    network_flags = NetLink.Flags.NLM_F_REQUEST
    network_flags |= NetLink.Flags.NLM_F_ACK
    network_flags |= NetLink.Flags.NLM_F_CREATE
    family = socket.AF_INET
    prefix = '\n\x01\x00\x00'
    prefix_len = 24
    gateway = '\n\x00\x00\x01'
    attributes = {
        Network.Type.Attribute.RTA_DST: prefix,
        Network.Type.Attribute.RTA_GATEWAY: gateway,
    }
    neighbor = cls.format(family, 0, prefix_len, 0, Network.Type.Table.RT_TABLE_MAIN, Network.Type.Protocol.RTPROT_EXABGP, Network.Type.Scope.RT_SCOPE_UNIVERSE, Network.Type.Type.RTN_UNICAST, Network.Type.Flag.RTM_F_PREFIX, attributes)
    return cls.extract(Network.Command.RTM_NEWROUTE, network_flags, family, neighbor)

dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/netlink/route/network.py Network.newRoute/original