From 370bd94a6b6463fda677f16819de77b894eedb5d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 12 Nov 2019 10:37:40 -0600 Subject: [PATCH] netutils/netlib/netlib_getdevs.c: Add comments and a placeholder for the RTM_NEWROUTE response. --- netutils/netlib/netlib_getdevs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/netutils/netlib/netlib_getdevs.c b/netutils/netlib/netlib_getdevs.c index 52e3d982a..958ec2266 100644 --- a/netutils/netlib/netlib_getdevs.c +++ b/netutils/netlib/netlib_getdevs.c @@ -203,10 +203,14 @@ ssize_t netlib_get_devices(FAR struct netlib_device_s *devlist, switch (resp.hdr.nlmsg_type) { + /* NLMSG_DONE means that the entire list of devices has been returned */ + case NLMSG_DONE: enddump = true; break; + /* RTM_NEWLINK provides information about one device */ + case RTM_NEWLINK: { FAR struct rtattr *attr; @@ -252,6 +256,17 @@ ssize_t netlib_get_devices(FAR struct netlib_device_s *devlist, } break; + /* RTM_NEWROUTE provides routing information for the device + * (address, gateway, etc.) + */ + + case RTM_NEWROUTE: + { + fprintf(stderr, "WARNING: RTM_NEWLINK Message type not " + "implemented\n"); + } + break; + default: fprintf(stderr, "ERROR: Message type %u, length %lu\n", resp.hdr.nlmsg_type, (unsigned long)resp.hdr.nlmsg_len);