; the general section contains all the general settings for router

general
{
; mandatory configuration command section network, site and router

    network /ndn/         ; name of the network the router belongs to in ndn URI format
    site /memphis.edu/    ; name of the site the router belongs to in ndn URI format
    router /cs/pollux/    ; name of the network the router belongs to in ndn URI format

; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs

    lsa-refresh-time 1800      ; default value 1800. Valid values 240-7200

; log-level is to set the levels of log for NLSR

    log-level  INFO       ; default value INFO, valid value DEBUG, INFO
    log-dir /var/log/nlsr/  ; path for log directory (Absolute path)
    seq-dir /var/lib/nlsr/  ; path for sequence directory (Absolute path)
}

; the neighbors section contains the configuration for router's neighbors and hello's behavior

neighbors
{
; in case hello interest timed out, router will try 'hello-retries' times at 'hello-time-out'
; seconds interval before giving up for any neighbors (deciding link is down)

   hello-retries 3                     ; interest retries number in integer. Default value 3
                                       ; valid values 1-10

   hello-timeout 1                    ; interest time out value in integer. Default value 1
                                       ; Valid values 1-15

   hello-interval  60                  ; interest sending interval in seconds. Default value 60
                                       ; valid values 30-90
; neighbor command is used to configure router's neighbor. Each neighbor will need
; one block of neighbor command

   neighbor
   {
       name /ndn/memphis.edu/cs/castor        ; name prefix of the neighbor router consists
                                              ; of network, site-name and router-name

       face-uri  udp://castor.cs.memphis.edu  ; face id of the face connected to the neighbor
       link-cost 25                         ; cost of the connecting link to neighbor
   }

   neighbor
   {
       name /ndn/memphis.edu/cs/mira          ; name prefix of the neighbor router consists
                                              ; of network, site-name and router-name

       face-uri  udp://mira.cs.memphis.edu    ; face id of the face connected to the neighbor
       link-cost 30                        ; cost of the connecting link to neighbor
   }
}

; the hyperbolic section contains the configuration settings of enabling a router to calculate
; routing table using [hyperbolic routing table calculation](http://arxiv.org/abs/0805.1266) method

hyperbolic
{
; commands in this section follows a strict order
; the switch is used to set hyperbolic routing calculation in NLSR

    state off             ; default value 'off', set value 'on' to enable hyperbolic routing table
                           ; calculation which turns link state routing 'off'. set value to 'dry-run"
                           ; to test hyperbolic routing and compare with link state routing.


    radius   123.456       ; radius of the router in hyperbolic coordinate system
    angle    1.45          ; angle of the router in hyperbolic coordinate system
}


; the fib section is used to configure fib entry's type to ndn FIB updated by NLSR

fib
{
; the max-faces-per-prefix is used to limit the number of faces for each name prefixes
; by NLSR in ndn FIB

    max-faces-per-prefix 3   ; default value 0. Valid value 0-60. By default (value 0) NLSR adds
                             ; all available faces for each reachable name prefixes in NDN FIB

}

; the advertising section contains the configuration settings of the name prefixes
; hosted by this router

advertising
{
; the ndnname is used to advertised name from the router. To advertise each name prefix
; configure one block of ndnname configuration command for every name prefix.

    prefix /ndn/edu/memphis/cs/netlab           ; name in ndn URI format
    prefix /ndn/edu/memphis/sports/basketball
}

security
{
  validator
  {
    rule
    {
      id "NSLR Hello Rule"
      for data
      filter
      {
        type name
        regex ^[^<nlsr><INFO>]*<nlsr><INFO><><>$
      }
      checker
      {
        type customized
        sig-type rsa-sha256
        key-locator
        {
          type name
          hyper-relation
          {
            k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><ksk-.*><ID-CERT>$
            k-expand \\1\\2
            h-relation equal
            p-regex ^([^<nlsr><INFO>]*)<nlsr><INFO><><>$
            p-expand \\1
          }
        }
      }
    }

    rule
    {
      id "NSLR LSA Rule"
      for data
      filter
      {
        type name
        regex ^[^<nlsr><LSA>]*<nlsr><LSA>
      }
      checker
      {
        type customized
        sig-type rsa-sha256
        key-locator
        {
          type name
          hyper-relation
          {
            k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><ksk-.*><ID-CERT>$
            k-expand \\1\\2
            h-relation equal
            p-regex ^([^<nlsr><LSA>]*)<nlsr><LSA>(<>*)<><>$
            p-expand \\1\\2
          }
        }
      }
    }

    rule
    {
      id "NSLR Hierarchy Exception Rule"
      for data
      filter
      {
        type name
        regex ^[^<KEY><%C1.O.R.>]*<%C1.O.R.><><KEY><ksk-.*><ID-CERT><>$
      }
      checker
      {
        type customized
        sig-type rsa-sha256
        key-locator
        {
          type name
          hyper-relation
          {
            k-regex ^([^<KEY><%C1.O.N.>]*)<%C1.O.N.><><KEY><ksk-.*><ID-CERT>$
            k-expand \\1
            h-relation equal
            p-regex ^([^<KEY><%C1.O.R.>]*)<%C1.O.R.><><KEY><ksk-.*><ID-CERT><>$
            p-expand \\1
          }
        }
      }
    }

    rule
    {
      id "NSLR Hierarchical Rule"
      for data
      filter
      {
        type name
        regex ^[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
      }
      checker
      {
        type hierarchical
        sig-type rsa-sha256
      }
    }

    trust-anchor
    {
      type file
      file-name "root.cert"
    }
  }
  ; cert-to-publish "root.cert" //optional, a file containing the root certificate. only the router
                                //that is designated to publish root cert needs to specify this
  ; cert-to-publish "site.cert" //optional, a file containing the root certificate. only the router
                                //that is designated to publish site cert need to specify this
  ; cert-to-publish "operator.cert" //optional, a file containing the root certificate. only the
                                    //router that is designated to publish operator cert need to
                                    //specify this
  ; cert-to-publish "router.cert" //required, a file containing the router certificate.
}
