#
#       lispd example config file for OpenWRT
#
package 'oor'

# General configuration
#   debug: Debug levels [0..3]
#   log_file: Specifies log file used in daemon mode. If it is not specified,  
#     messages are written in syslog file
#   map_request_retries: Additional Map-Requests to send per map cache miss
#   ipv6_scope [GLOBAL|SITE]: Scope of the IPv6 address used for the locators. GLOBAL by default
#   operating_mode: Operating mode can be any of: xTR, RTR, MN, MS, DDT, MR
config 'daemon'
        option  'debug'                 '0'
        option  'log_file'              '/tmp/oor.log'  
        option  'map_request_retries'   '2'
        option  'ipv6_scope'            '<GLOBAL|SITE>'
        option  'operating_mode'        'xTR'

#---------------------------------------------------------------------------------------------------------------------

# Map Server (MS) configuration


# Control messages are received and generated through this interface
# Only one interface is supported
config 'ms_basic'
        option  'control_iface'         '<iface-name>'

# Define an allowed lisp site to be registered into the Map Server
#   eid_prefix: Accepted EID prefix (IPvX/mask)
#   key_type: Only 1 supported (HMAC-SHA-1-96)
#   key: Password to authenticate the received Map Registers
#   iid: Instance ID associated with the lisp site [0-16777215]
#   accept_more_specifics [true/false]: Accept more specific prefixes
#     with same authentication information
#   proxy_reply [true/false]: If set to "true", the Map Server proxy replys
#     requests to this site ignoring the proxy-reply bit of the map register.
#     False by default.
#   ddt_ms_peers_complete [true/false]: List of ms-peers is complete.
#     True by default.
#   ddt_ms_peers: List of all other DDT Map-Servers performing
#     Map-Server functionality for the same prefix
config 'lisp-site'
        option   'eid_prefix'               '<ip-prefix/mask>'
        option   'key_type'                 '1'
        option   'key'                      '<string>'
        option   'iid'                      '0'
        option   'accept_more_specifics'    '<bool>'
        option   'proxy_reply'              '<bool>'
        option   'ddt_ms_peers_complete'    '<bool>'
        list     'ddt_ms_peers'             '<string>'
        list     'ddt_ms_peers'             '<string>'
        ...

# Define a staticly registered mapping. New can Map Registers overwrite
# the information of this mapping
#   eid_prefix: EID prefix (IPvX/mask) of the mapping
#   iid: Instance ID associated with the lisp site [0-16777215]
#   rloc_set: Name of the set of rlocs to be used
config 'ms-static-registered-site'
        option   'eid_prefix'               '<ip-prefix/mask>'
        option   'iid'                      '0'
        option   'rloc_set'                 '<string>'

#
# NAT-Traversal support
#

# Define an RTRs that can be used to work with this Map Server. Several
# ms-rtr-node can be defined.
#
#   name: Name to define the RTR used as a reference in the rest of the 
#     configuration
#   address: IPv4 or IPv6 address of the RTR
#   key: Password to authenticate the messages between the RTR and the MS

config 'ms-rtr-node'
        option   'name'                 '<string>'
        option   'address'              '<ip-address | FQDN>'
        option   'key'                  '<string>'

# Define a set of RTRs that can be used  to work with this Map Server.
# Several ms-rtrs-set can be defined.
#
#   name: Name to define the RTR set used as a reference in the rest of the 
#     configuration
#   ttl: The time in minutes the recipient of the Info-Reply will
#     store the RTR Information. 1 day by default
#   rtrs: List of ms-rtr-nodes identified by its name

config 'ms-rtrs-set'
        option   'name'                 '<string>'
        option   'ttl'                  '<int>'
        list     'rtrs'                 '<string>'
        list     'rtrs'                 '<string>'
        ...

# Set of RTRs used in the Info-Reply messages sent to requesters xTRs
#
# ms-advertised-rtrs-set: Name of the ms-rtrs-set to be announced by the MS

config 'ms-advertised-rtrs-set'
        option   'name'                 '<string>'
   
#---------------------------------------------------------------------------------------------------------------------

#
# DDT-NODE configuration
#

# Control messages are received and generated through this interface
# Only one interface is supported
config 'ddt_node_basic'
        option  'control_iface'         '<iface-name>'

# Define a lisp-site for which this DDT-NODE is authoritative. Several
# lisp-site can be defined.
#
#   eid_prefix: Authoritative EID prefix (IPvX/mask)
#   iid: Instance ID associated with the lisp site [0-16777215]

config 'ddt-auth-site'
        option   'eid_prefix'               '<ip-prefix/mask>'
        option   'iid'                      '0'


# Define a static registered delegation.
# You can define several eid-prefix.
#   eid_prefix: EID prefix (IPvX/mask) of the delegation
#   iid: Instance ID associated with the lisp site [0-16777215]
#   delegation-type: Indicates if at least one of the delegated sites is a MS for this xeid
#   deleg-nodes: A number of IP addresses, each could be IPv4 or IPv6

config 'ddt-deleg-site'
        option   'eid_prefix'               '<ip-prefix/mask>'
        option   'iid'                      '0'
        option   'delegation-type'          '<CHILD_DDT_NODE/MAP_SERVER_DDT_NODE>'
        list     'deleg_nodes'              '<ip-address | FQDN>'
        ...

#---------------------------------------------------------------------------------------------------------------------

#
# DDT-MAP RESOLVER configuration
#

# Control messages are received and generated through this interface
# Only one interface is supported
config 'mr_basic'
        option  'control_iface'         '<iface-name>'

# Define the current addresses for DDT-Root.
#   address: IPv4 or IPv6 address of the DDT-Root

config ddt-root-addresses
        list   'address'                '<ip-address | FQDN>'

#---------------------------------------------------------------------------------------------------------------------

# Tunnel Router general configuration
# Common for xTR, RTR & MN

# encapsulation: Encapsulation that will use OOR in the data plane.
#   type [LISP|VXLANGPE]. LISP is selected by default

config 'encapsulation'
        option  'type'              '<LISP|VXLANGPE>'

# RLOC Probing configuration
#   rloc_probe_interval: interval at which periodic RLOC probes are sent (seconds). A value of 0 disables RLOC Probing
#   rloc_probe_retries: RLOC Probe retries before setting the locator with status down. [0..5]
#   rloc_probe_retries_interval: interval at which RLOC probes retries are sent (seconds) [1..rloc_probe_interval]
        
config 'rloc-probing'        
        option  'rloc_probe_interval'           '30'
        option  'rloc_probe_retries'            '2'
        option  'rloc_probe_retries_interval'   '5'


# Encapsulated Map-Requests are sent to this map-resolver
# You can define several map-resolvers. Encapsulated Map-Request messages will be sent to only one.
#   address: IPv4 or IPv6 address of the map resolver
config 'map-resolver'
        list  'address'                 '<ip-address | FQDN>'


# Static Map Entry of the Map Cache
#   eid-prefix: EID prefix (IPvX/mask) of the mapping
#   iid: Instance ID associated to the EID. When using VXLAN-GPE, iid configures
#     the VNI of the mapping. [0-16777215]
#   rloc_set: Name of the set of rlocs to be used
config 'static-map-cache'
        option   'eid_prefix'           '<ip-prefix/mask>'
        option   'iid'                  '0'
        option   'rloc_set'             '<string>'

#---------------------------------------------------------------------------------------------------------------------
        
# xTR configuration

# NAT Traversl configuration.
#   nat_traversal_support: check if the node is behind NAT.

config 'nat-traversal'
        option  'nat_traversal_support' '<on|off>'


# List of allowed destination EID prefixes. If not defined,
# all traffic will be processed by OOR.
#
# config 'allowed-dst-eids'
#       list  'eid_prefix'              '<ip-prefix/mask>'
#   ...
#}


# Map-Registers are sent to this map-server
# You can define several map-servers. Map-Register messages will be sent to all of them.
#	address: IPv4 or IPv6 address of the map-server
#   key_type: Only 1 supported (HMAC-SHA-1-96)
#	key: password to authenticate with the map-server
#   proxy_reply [on/off]: Configure map-server to Map-Reply on behalf of the xTR

config 'map-server'
        option   'address'              '<ip-prefix/mask>'
        option   'key_type'             '1'			
        option   'key'                  '<string>'
        option   'proxy_reply'          '<on|off>'

# IPv4 / IPv6 EID of the node.
#   eid-prefix: EID prefix (IPvX/mask) of the mapping
#   iid: Instance ID associated to the EID. When using VXLAN-GPE, iid configures
#     the VNI of the mapping. [0-16777215]
#   ttl: Time in minutes the recipient of the Map-Reply will store the mapping.
#     Default value is 10 minutes
#   rloc_set: Name of the set of rlocs to be used
config 'database-mapping'
        option   'eid_prefix'           '<ip-prefix/mask>'
        option   'iid'                  '0'
        option   'ttl'                  '10'
        option   'rloc_set'             '<string>'

# List of PITRs to SMR on handover
#   address: IPv4 or IPv6 address of the Proxy-ITR
config 'proxy-itr'
        list   'address'                '<ip-address | FQDN>'

# Current LISP beta-network (lisp4.net/lisp6.net) PITR addresses
# Uncomment the IPv4 or IPv6 list based on your current locators

#config 'proxy-itr'
#        list     'address'              '69.31.31.98'                   # eqx-ash-pxtr
#        list     'address'              '129.250.1.63'                  # ntt-amer-pxtr
#        list     'address'              '217.8.98.33'                   # intouch-pxtr-1
#        list     'address'              '203.181.249.172'               # apan-pxtr
#        list     'address'              '202.51.247.10'                 # sg-nus-pxtr
#        list     'address'              '2001:590::451f:1f62'           # eqx-ash-pxtr
#        list     'address'              '2001:418:0:1000::63'           # ntt-amer-pxtr
#        list     'address'              '2001:40B0:7500:205:1::E'       # intouch-pxtr-1
#        list     'address'              '2001:200:e000:17::172'         # apan-pxtr

# Packets addressed to non-LISP sites will be encapsulated to this Proxy-ETR
# You can define several Proxy-ETR for IPv4 EIDs and for IPv6 EIDs. Traffic 
# will be balanced according to the priority and weight.
#   address: IPv4 or IPv6 address of the Proxy-ETR
#   priority [0-255]: Proxy-ETR with lower values are more preferable.
#   weight [0-255]: When priorities are the same for multiple Proxy-ETRs, the Weight indicates how to balance 
#    unicast traffic between them.

# Proxy for IPv4 EIDs
config 'proxy-etr-ipv4'
        option   'address'              '<ip-address | FQDN>'
        option   'priority'             '<int>'
        option   'weight'               '<int>'

#Proxy for IPv6 EIDs
config 'proxy-etr-ipv6'
        option   'address'              '<ip-address | FQDN>'
        option   'priority'             '<int>'
        option   'weight'               '<int>'
        
#---------------------------------------------------------------------------------------------------------------------

# RTR configuration


# List of interafaces to be used as outgoing interfaces of the packets sent
# by the RTR. One for each RLOC
#   iface: interface containing the RLOCs to be used for outgoing traffic 
#   ip_version: 4 to use IPv4 address of the interface and 6 to use IPv6 
#     address of the interface
#   priority [0-255]: Priority for the IPvX RLOC of the interface. Locators
#     with lower values are more preferable. This is used for outgoing 
#     traffic policy management.
#   weight [0-255]: When priorities are the same for multiple RLOCs, the Weight
#     indicates how to balance unicast traffic between them.        
config 'rtr-iface'
        option   'iface'                '<iface-name>'
        option   'ip_version'           '<4/6>'
        option   'priority'             '<int>'
        option   'weight'               '<int>'
               
#
# NAT-Traversal support
#

# Define a MS that can be used to work with this RTR. Several
# rtr-ms-node can be defined.
#
#   address: IPv4 or IPv6 address of the map-server
#   key: Password to authenticate the messages between the RTR and the MS
#   draft-version: OLD for Map Servers implementing draft version previous to 4
#     NEW for Map Servers implementing darft version 4 or later
#     OLD is the default value

config 'rtr-ms-node'
        option   'address'              '<ip-address / FQDN>'
        option   'key'                  '<string>'
        option   'draft_version'        '<OLD|NEW>'

        
#---------------------------------------------------------------------------------------------------------------------

# Miscellaneous configuration


# Set of rlocs to be used in mappings
#   name: Name of the set of rlocs
#   rloc_name: List of each of the names of the rlocs to be used in the set.
#     It can be used rloc-address or rloc-iface
config 'rloc-set'
        option   'name'                 '<string>'
        list     'rloc_name'            '<string>'

# RLOC defined with an IP address
#   name: Name of the rloc to be used in rloc-set
#   address: It could be one of the following cases
#      - IPv4 or IPv6 address of the rloc.
#      - ELP name
#   priority [0-255]: Priority for the IPvX RLOC. Locators with
#     lower values are more preferable. This is used for both incoming
#     policy announcements and outgoing traffic policy management.
#   weight [0-255]: When priorities are the same for multiple RLOCs, the Weight
#     indicates how to balance unicast traffic between them.
#   local [true|false]: Indicates if the locator is local to the xTR. 
#     by default is true. To use remote locators,the proxy_reply field of
#     the map-server section should be enabled.
config 'rloc-address'
        option   'name'                 '<string>'
        option   'address'              '<ip-address>'
        option   'priority'             '<int>'
        option   'weight'               '<int>'
        option   'local'                '<bool>'

# RLOC defined with a network interface
#   name: Name of the rloc to be used in rloc-set
#   interface: interface containing the RLOCs to be used 
#   ip_version: 4 to use IPv4 address of the interface and 6 to use IPv6 
#     address of the interface
#   priority [0-255]: Priority for the IPvX RLOC. Locatorsn with
#     lower values are more preferable. This is used for both incoming
#     policy announcements and outgoing traffic policy management.
#   weight [0-255]: When priorities are the same for multiple RLOCs, the Weight
#     indicates how to balance unicast traffic between them.        
config 'rloc-iface'
        option   'name'                 '<string>'
        option   'interface'            '<iface-name>'
        option   'ip_version'           '<4/6>'
        option   'priority'             '<int>'
        option   'weight'               '<int>'


# Structure to define a path involving multiple hops.
#   elp_name: Name used to define the ELP used as a reference in the address of the rloc-address 
#        structure. For each hope use same elp_name. They should appear in order.
#   address: IPv4 or IPv6 address of the rloc. The address of the last element of the path should
#       exist and be assigned to an UP interface during starting process otherwise
#       it is discarded.
#   strict [true/false]: Not yet implemented. Use false
#   probe [true/false]: Not yet implemented. Use false
#   lookup [true/false]: Not yet implemented. Use false        
config 'elp-node'
        option   'elp_name'             '<string>'
        option   'address'              '<ip-address>'
        option   'strict'               'false'
        option   'probe'                'false'
        option   'lookup'               'false'
