Project

General

Profile

ConfigFileFormat » History » Revision 2

Revision 1 (Alex Afanasyev, 01/21/2014 04:54 PM) → Revision 2/19 (Junxiao Shi, 02/07/2014 09:19 PM)

# Config file format 
 ================== 

 Initial state of NFD daemon is configured using the configuration file in YAML format.    The following shows an [INI file](http://en.wikipedia.org/wiki/INI_file).   

 ## INI details 

 * Blank lines are allowed. 
 * Comments must start example configuration: 

     # NFD configuration file sample with `;`, and must appear on its own line. 
 * Sections must be used. Properties cannot be declared out of sections. 
 * Section and property names are case-sensitive. 
 * Duplicate section names and duplicate property names are allowed. 
 * Whitespaces are not allowed at beginning of the line, or around the equal sign. Whitespaces after the equal sign are part of the value. 
 * Escape characters are not supported. 

 ## Example explanation 
     #  
     # NFD uses YAML format configuration 

	 ; the process section defines settings of nfd process 
	 [process] 
	 pidfile=/tmp/nfd.pid 
	 ; filename where NFD writes its PID upon startup 
	 uid=ndn 
	 ; uid to change into after initialization 
	 gid=ndn 
	 ; gid to change into after initialization 
	
	 ; a channel section defines a channel 
	 ; it can be repeated to file. 
    
     process: 
       pidfile: /var/run/nfd.pid 
    
     listeners: # define multiple channels 
	 [channel] 
	 name=unix 
	 ; listeners 
       unix: # name of channel, listener, must be unique 
	 proto=unix 
	 ; unique, to be referenced in other sections 
         proto: unix # underlying protocol 
	 path=/var/run/nfd.sock 
	 ; 
         path: /var/run/nfd.sock # (UNIX) path 
	 listen=y 
	 ; 
         face_auth: false # whether to start listening 

	 [channel] 
	 name=tcp 
	 proto=tcp 
	 port=6363 
	 ; require face authentication on new clients 
       tcp: 
         proto: tcp 
         port: 6363 # (TCP) listen port 
	 listen=y 
	
	 [channel] 
	 name=udp 
	 proto=udp 
	 port=6363 
	 ; 
         face_auth: true 
       udp: 
         proto: udp 
         port: 6363 # (UDP) listen port 
	 listen=y 
	
	 [channel] 
	 name=udp_mcast 
	 proto=udp 
	 port=56363 
	 mcast_group=224.0.23.170 
	 ; (UDP) join multicast group 
	 local_ip=192.0.2.1 
	 ; (UDP mcast) local IP to use; must belong to a local NIC 
	
	 [channel] 
	 name=ether 
	 proto=ether 
	 dev=eth1 
	 ; 
         face_auth: false 
       udp_mcast: 
         proto: udp 
         port: 56363 
         face_auth: false 
       ether: 
         proto: ether 
         dev: eth1 # (Ethernet) local NIC 
	 wire=ndnlp 
	    
	 ; an auth section defines an authorized key 
	 ; it can be repeated to 
         wire: ndnlp # wire protocol 
         face_auth: false 
    
     faces: # define multiple authorized keys 
	 [auth] 
	 keyfile=/etc/nfd/keys/1.pub 
	 ; path to a public key, should be readable by root only 
	 privilege=fib 
	 privilege=stats 
	 ; a privilege granted to this public key 
	 ; privilege property can be repeated to grant multiple privileges outgoing faces 
       - 
         proto: tcp 
         host: hub1.example.com # (TCP or UDP) remote host 
         port: 6363 # (TCP or UDP) remote port 
         prefix: # forward prefix registrations 
           - /example 
         reverse_prefix: # reverse perfix registrations 
           - /example/hub1/home2 
       - 
         listener_key: udp_mcast 
         mcast_group: 224.0.23.170 # multicast group; mutually exclusive with host 
         port: 6363 
       - 
         listener_key: ether 
         host: 01:01:01:01:01:01 # (Ethernet) remote host 
    
     strategy: # define forwarding strategy for namespace 
       /: # namespace 
         original # strategy name 
       /example/broadcast: # namespace 
         bcast # strategy name