Commit Graph
68 Commits
Author SHA1 Message Date
Steve DiBenedetto ca53ac6b00 face, mgmt: improve face creation failure and bad URI handling
Prevent creation of faces to endpoints owned by NFD instance

Prevent creation of UDP broadcast faces (255.255.255.255 and
those belonging to machine's interfaces) in response to
face creation command

Sanity check configuration file port numbers in face manager

refs: #1414, #1427

Change-Id: Ia3f0a9337f3d97c34388773eab05bc39ad6dd804
2014-04-06 10:54:20 -07:00
Junxiao Shi 6e69432262 face/mgmt/fw/tools: add localUri to FaceStatus and FaceEventNotification
refs #1396

Change-Id: I6084745c62c44a409ecbd4a795cb712475e32416
2014-04-03 10:27:13 -07:00
Junxiao Shi 79494164c3 face: Face::getLocalUri
refs #1396

Change-Id: Icf02ae0a4136b6da3f6388cdce2f861bec44e940
2014-04-02 18:43:01 -07:00
Steve DiBenedetto bf6a93da4e core: change logging from environment variable to configuration file-based
GlobalConfigurationFixture uses unit-tests.conf to determine default
and module specific logging levels. Logging will gracefully default to
INFO if unit-tests.conf is not found. See unit-tests.conf.sample for a
sample configuration file.

refs: #1375, #1267

Change-Id: Ib0c4eb4149748e6658f94ef1afa23ddd3072c0fa
2014-03-31 20:46:51 -06:00
Junxiao Shi 98e29f4731 core: delete deprecated getGlobalScheduler() API
refs #1290

Change-Id: If994e3bd303f0788d8e945351c182bbd4ab5e0b2
2014-03-31 10:27:26 -07:00
Steve DiBenedetto 7564d97d13 mgmt: refactor management modules to conform to NFD Management Protocol
Refactor management protocol specific option types to ControlParameters
Add control parameter field enforcement
Add missing control response "success" message bodies
Update fib management protocol response codes and behavior
Merge local control header manager into face manager
Refactor references of nfd::LocalControlHeaderFeature enum to ndn::nfd::LocalControlFeature
Remove "control-header" privilege from default configuration

refs: #1397, #1399, #1400

Change-Id: Id042daf00b3cee1f1c7fa38d2e4a4ff6d95c15c6
2014-03-25 17:46:31 -06:00
Alexander Afanasyev 53a6fd33b9 face: Implementing forgotten isListening() feature in TcpChannel
Change-Id: Idfcd8337d16b414d2f739f936660dffdce413729
2014-03-24 17:01:45 -07:00
Alexander Afanasyev 5a8d8d848c face: Remove reliance on exceptions during TLV decoding
Change-Id: I8e96cc9369a5702805d3856ce70dfbe64834e1df
Refs: #1379
2014-03-22 17:27:15 -07:00
Davide Pesavento e4631003a9 face: silence silly warning thrown by clang.
Clang 3.3 complains about a "missing field initializer" for struct ifreq.
However, according to the standard, if there are fewer initializers in a
brace-enclosed list than there are elements or members of an aggregate,
the remainder of the aggregate shall be initialized implicitly as if they
were declared static, i.e. with zero or default-constructed value.

Therefore using "= {0}" is correct (and common practice in C). Emitting
a warning doesn't make sense. As a matter of fact recent GCC releases
disabled it.

Luckily this is C++ and we can simply use the "empty braces" initializer
(which wouldn't be valid C99 syntax) to silence the compiler.

Change-Id: Ibee8d17cc9b5d0eaa5270c52f3596b7994b5e911
2014-03-21 15:44:42 -07:00
Davide Pesavento d8d4d98656 face: delete redundant protocol typedefs.
Change-Id: I32e1100e7395070a29ee813658aac82b63b6c4f2
2014-03-21 23:34:33 +01:00
Davide Pesavento 73c65d7bae face: mark UnixStreamFace constructor explicit.
The keyword was accidentally removed in commit
355c066fe1.

Change-Id: I1e345cf5ccb1d5ddc56419fb19493eb446590880
2014-03-21 18:08:59 +01:00
Davide Pesavento b60cc1298d face: use NetworkInterfaceInfo directly in EthernetFace.
Finally getting rid of EthernetFactory::findAllInterfaces()
and EthernetFace::getInterfaceAddress().

Change-Id: I94fe2016cc98778af3115569b1d21d5c48425d9c
2014-03-20 21:07:22 -07:00
Alexander Afanasyev 355c066fe1 face: Implementing new "isOnDemand" flag
This flags replaces isPermanent flag in datagram faces, but with the
reversed logic (isPermanent = !isOnDemand)

Change-Id: I37ba604e5f105ca95a79a08b8cfc3d640df8b412
Refs: #1376
2014-03-20 18:10:44 -07:00
Alexander Afanasyev eb3197fa35 all: Update code to compile with latest time-related changes in ndn-cpp-dev library
Change-Id: I7e859989c833001f49b286d4a9917f4dc740b4a4
2014-03-18 17:34:12 -07:00
Davide Pesavento 9eaeac7716 face: enable promiscuous mode in Ethernet face.
This is a temporary hack to be able to receive NDN packets sent to
an Ethernet multicast address different from the broadcast address.
It'll be removed when task #1278 is properly implemented.

Change-Id: I87380637ef2993cf28889ab69f13dc8b75b9644e
2014-03-15 10:18:33 +01:00
Alexander Afanasyev eee71fd6bc face: Disable IPv4-mapping of IPv6 addresses in TCP and UDP channels
Change-Id: I9997ed4114b9708778ee55f82f567264dede6798
Refs: #1352
2014-03-13 17:49:00 -07:00
Davide Pesavento 56fb59799d face: Implementation of ethernet::Address::fromString()
Change-Id: I18279bee23f8e80ee667099c1207e50556fbd1a1
2014-03-12 10:47:01 -07:00
Giulio Grassi 69871f03d3 face: close idle Datagram faces
refs #1281

Change-Id: Ifc766964f653d3991b55d76361c8b9bbe5d630cf
2014-03-11 15:54:48 -07:00
Davide Pesavento 248d6bd666 core: add free function to enumerate network interfaces.
Change-Id: Icd89662afe9e1295cd18a615970c5b4299529b38
Refs: #1306
2014-03-11 12:17:49 -07:00
Alexander Afanasyev 7e698e6aac face: Incrementing Face counters
Change-Id: Ia1d7917bb52cf01ab2ff304638bc9f6cbdb2626f
Refs: #1178
2014-03-08 20:27:43 +00:00
Alexander Afanasyev 6f5ff63f86 face: Fixing a bug in UdpChannel with missing async_receive
In cases when UdpChannel dispatches received UDP packet to a newly
created UdpFace, the Channel failed to resume reception of datagram on
the channel.

Change-Id: If876dacc237bd0a6a660d4d88581959782dc349b
2014-03-08 20:27:43 +00:00
Alexander Afanasyev 69a342712d face: Fix bug when TcpChannel::handleSuccessfulConnect seem to be called before channel is acutally connected
Change-Id: Ibf50da48f01137649ffd90e8f6d16c4f03c87a2b
Refs: #1344
2014-03-08 01:58:47 -08:00
Alexander Afanasyev a39b90b2aa face: Implementing Face::getUri() method
Change-Id: I9a9f774b95784e5b7ec75472f1cc6cf64c4e5d7b
Refs: #1319
2014-03-06 09:25:06 +00:00
Junxiao Shi 61e3cc51ed faces: Channel base class
refs #1261

Change-Id: If17037c4802cb6ccec0201c3bff7fc4b6db41c6a
2014-03-05 11:56:10 -07:00
Junxiao Shi a4f2be8248 fw: FaceTable
refs #1317

Change-Id: Ief04fe572407120ca6777c087a519c1749f0cdd2
2014-03-04 14:32:04 -07:00
Giulio Grassi 624f6c610f face: UDP face/channel/factory
Change-Id: I4683b45378637133982efd23edd16a0c35148948
refs #1189
2014-03-02 13:29:10 +01:00
Alexander Afanasyev 5f1ec25245 face: Minor updates of TCP faces
Change-Id: I9a11fb4b2cd1aaaa670313cab0b08f097554e1fc
2014-02-28 16:12:46 -08:00
Alexander Afanasyev d665530904 face: Adding new 'createFace' method in all Factories
This method accepts parsed URI object and attempts to create Face on the
right channel (e.g., if hostname in URI resolved to IPv6, IPv6 TCP channel
will be used).

Factories that do not support 'createFace' operation will throw an exception.

As of this commit, *Factory::create methods are renamed to more explicit
*Factory::createChannel, and *Factory::connect to *Factory::createFace.
All other Factory-specific methods should denote what exactly is
created: channel, face, or multicast face.

Change-Id: I6396dc84c4cd8bbcdde9f55cfac90635d99e93e9
Refs: #1195
2014-02-28 16:12:12 -08:00
Alexander Afanasyev 0eb70659f7 face: Rename all ChannelFactories to protocol Factories
Base class is ProtocolFactory and implementations are TcpFactory,
UnixStreamFactory, EthernetFactory.

Since Factories are doing more than just creating channels (some can
create faces directly), more general name is more appropriate.

Change-Id: I3d6c2460a1b29e244f8462453720f4e7785893ca
2014-02-28 12:54:16 -08:00
Alexander Afanasyev 7329e02f60 face: Convert to use the global IO service by all ChannelFactories
Change-Id: Ibd8d5cea142171b5700d8920eb3eedc084bbd588
2014-02-28 11:04:40 -08:00
Davide Pesavento 0ff10db95a face: remove awkward Face::setLocal, use a constructor argument instead.
Change-Id: Ic366ecdc83c5771138ff584ffb944a4e17300eb1
2014-02-28 08:45:14 -08:00
Alexander Afanasyev ef968e15d5 face: Ignoring fireware interfaces (fw*) in EthernetChannelFactory
Change-Id: Ibfb512ce1229e74eee4c66efd87d6dc4a18c057e
2014-02-27 21:25:33 -08:00
Davide Pesavento 44deacc811 face: Ethernet{Face,ChannelFactory} implementation.
refs: #1191

Change-Id: I08b7ebfdc5d70fb494b1f23bd7b1a77cf18653a1
2014-02-27 18:18:34 +01:00
Davide Pesavento 855bf2999c face: Fix minor typo in TcpChannel method name.
Change-Id: I93d8ba199de972422e9380455e13254085438720
2014-02-26 21:21:59 -08:00
Alexander Afanasyev bfd31de5a9 build: Requiring boost >=1.48 during configure step
Change-Id: I09110e9993903a3157be22948a7275c4625cd393
Refs: #1186
2014-02-26 15:32:34 -08:00
Junxiao Shi c041ca36ed core: global io_service and scheduler
Scheduler and time are imported from ndn-cpp-dev.
Forwarder is using the new scheduler API.
Face system is not transitioned yet.

refs #1290

Change-Id: I5679cb50bbf9890a105f663b038f13951403c2b6
2014-02-26 12:40:22 -07:00
Junxiao Shi df3b438c40 face: NDNLP encoding change
FragIndex and FragCount fields are encoded as nonNegativeInteger.

refs #1283

Change-Id: I4654078c3bfd73c83ce06ce6a9cd97952a4f49f8
2014-02-25 17:20:43 -08:00
Junxiao Shi 7860d4820a face: declare face counters
refs #1280

Change-Id: Ia1c50ab2b31d6131728489b3b038dc6f7608266f
2014-02-24 17:00:40 -07:00
Alexander Afanasyev 232c987a03 face: Implementing ip::address::is_loopback method for Boost <1.47
boost::ip::address::is_loopback method appeared only in Boost 1.47.
This commit enables the same functionality for earlier versions of
boost, based on implementation in 1.55.

Change-Id: I571408fc7db44eebd14405e7b7a9810b5d061802
2014-02-20 20:54:04 -08:00
Alexander Afanasyev bd220a053b face: Implementation of encode/decode of LocalControlHeader
LocalControlHeader can only be used on faces that are derived from
LocalFace.  UnixStreamFace is directly inherited from LocalFace,
TCP face has two specializations: generic TcpFace (strictly not local),
and LocalTcpFace.

refs #1213

Change-Id: I8a158c3bc4bb929eedd15757cfddecc0d1049f9f
2014-02-20 15:54:22 -08:00
Alexander Afanasyev c78b141e7e build: Detecting if UNIX socket is available and disabling it if it is not
Change-Id: Iacdffe36223c085136a4fe09587ce304a3029853
2014-02-19 16:16:10 -08:00
Davide Pesavento 9cec8ee5a8 face: Create the socket file in UnixStreamChannel world-writable.
Fixes a permission denied error when nfd is run as root and a non-root
application tries to communicate with it over a Unix face.

refs: #1272
Change-Id: I4ba60f9a9dfbec12d787424dff98f38b76b48cf0
2014-02-19 15:04:45 -08:00
Alexander Afanasyev 93ce75e6f7 face: Fixing bug with InternalFace considered not local and changing "isLocal" method to be pure virtual
This way the decision about the face locality has to be done explicitly
inside specific face implementation and potentially avoids problems.

Change-Id: I5219cce87385313546453d14a5a7ca4542893911
2014-02-19 14:11:07 -08:00
Junxiao Shi 8cf83ebc05 face: Face::setLocalControlHeaderFeature LLVM fix
workaround LLVM Bug 16816 on OS X 10.9

refs #1264

Change-Id: I364bfaf4ac4600bd031422dad36afd1377b87338
2014-02-18 14:25:05 -07:00
Junxiao Shi 16b8bc9c18 face: LocalControlHeader attributes
refs #1264

Change-Id: Iab8b875ea8102103390d2da37ca3c08ef58a3d55
2014-02-17 23:02:25 -07:00
Junxiao Shi c0d0591c69 face: fix warnings in NDNLP code
refs #1262

Change-Id: Iec17e22eefb04ee69f917c2826a1550906062013
2014-02-17 19:07:17 -07:00
Davide Pesavento ba558e7faf stream-face: invoke shutdown() before closing the socket.
As recommended by boost::asio documentation.
Also refactor the shutdown logic into its own method.

Change-Id: I033de350a9cb659439034f7b5bb36031cda87a25
2014-02-17 14:31:55 -08:00
Davide Pesavento bc4dd8c812 face: UnixStream{Face,Channel,ChannelFactory} implementation.
refs: #1174

Change-Id: I14d1e357c96a02995355e7970323fe40847580aa
2014-02-17 23:03:06 +01:00
Junxiao Shi d6dcd2c995 face: NDNLP partial message store
refs #1208

Change-Id: Ie10d590ebd2e3631c884a7b6b2d5ffce2758ab4d
2014-02-17 09:25:48 -07:00
Junxiao Shi 9b0d3e91b0 face: NDNLP slicer
refs #1206

Change-Id: Ifbf0aeedff8fc9300799c97772d988dce2fce306
2014-02-16 03:01:28 -07:00