[haiku-commits] Re: haiku: hrev46385 - src/kits/network/libnetapi headers/os/net headers/private/net

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 18 Nov 2013 18:51:15 +0100

On 18.11.2013 10:13, stefano.ceccherini@xxxxxxxxx wrote:
41d4206: Added family parameter to the GetRoutes() API.
   Moved common code to a private file.

Now it looks almost alright, thanks! Pointing out a few (mostly style) issues:

+ * Distributed under the terms of the MIT License.
+ */
+
+#ifndef ROUTESUPPORT_H_

No blank line there, but...

+#define ROUTESUPPORT_H_
+
+#include <ObjectList.h>
+
+status_t get_routes(const char* interfaceName,
+               int family, BObjectList<route_entry>& routes);
> +
> +#endif /* __ROUTESUPPORT_H_ */

Two at each place there. Also, this method should be in a private namespace, so that it is not exposed to the global namespace. Ie.:

namespace BPrivate {
...
}

  #include <NetServer.h>
-
+#include <RouteSupport.h>

  static int

Two blank lines here as well.

+++ b/src/kits/network/libnetapi/RouteSupport.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2013, Haiku, Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
+ */
+
+#include <errno.h>

And here.

+#include <net/if.h>
+#include <sys/sockio.h>
+
+#include <AutoDeleter.h>
+#include <ObjectList.h>
+#include <RouteSupport.h>
+
+status_t

And here.

Bye,
   Axel.


Other related posts: