n_time in trpt(8)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

n_time in trpt(8)

Lawrence Teo-7
In 2014, mpi@ substituted n_time, n_long, and n_short with their equivalent
u_int_* types throughout the network stack to remove the dependency on
<netinet/in_systm.h>:

http://marc.info/?l=openbsd-tech&m=140523875001860&w=2

As mentioned in his mail, trpt(8) is the only program in userland that uses
n_time.  The following diff does the final cleanup for trpt(8).

ok?


Index: trpt.c
===================================================================
RCS file: /cvs/src/usr.sbin/trpt/trpt.c,v
retrieving revision 1.33
diff -u -p -r1.33 trpt.c
--- trpt.c 27 Aug 2016 01:50:07 -0000 1.33
+++ trpt.c 1 Dec 2016 19:17:38 -0000
@@ -73,7 +73,6 @@
 #include <net/if.h>
 
 #include <netinet/in.h>
-#include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/in_pcb.h>
 #include <netinet/ip_var.h>
@@ -112,7 +111,7 @@ int tcp_debx;
 struct tcp_debug tcp_debug[TCP_NDEBUG];
 
 static caddr_t tcp_pcbs[TCP_NDEBUG];
-static n_time ntime;
+static u_int32_t ntime;
 static int aflag, follow, sflag, tflag;
 
 extern char *__progname;

Reply | Threaded
Open this post in threaded view
|

Re: n_time in trpt(8)

Stefan Sperling-5
On Wed, Dec 21, 2016 at 10:01:28PM -0500, Lawrence Teo wrote:

> In 2014, mpi@ substituted n_time, n_long, and n_short with their equivalent
> u_int_* types throughout the network stack to remove the dependency on
> <netinet/in_systm.h>:
>
> http://marc.info/?l=openbsd-tech&m=140523875001860&w=2
>
> As mentioned in his mail, trpt(8) is the only program in userland that uses
> n_time.  The following diff does the final cleanup for trpt(8).
>
> ok?

OK stsp@

I believe we prefer uint32_t over u_int32_t in new code.
I'm fine with either form in this case.


>
>
> Index: trpt.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/trpt/trpt.c,v
> retrieving revision 1.33
> diff -u -p -r1.33 trpt.c
> --- trpt.c 27 Aug 2016 01:50:07 -0000 1.33
> +++ trpt.c 1 Dec 2016 19:17:38 -0000
> @@ -73,7 +73,6 @@
>  #include <net/if.h>
>  
>  #include <netinet/in.h>
> -#include <netinet/in_systm.h>
>  #include <netinet/ip.h>
>  #include <netinet/in_pcb.h>
>  #include <netinet/ip_var.h>
> @@ -112,7 +111,7 @@ int tcp_debx;
>  struct tcp_debug tcp_debug[TCP_NDEBUG];
>  
>  static caddr_t tcp_pcbs[TCP_NDEBUG];
> -static n_time ntime;
> +static u_int32_t ntime;
>  static int aflag, follow, sflag, tflag;
>  
>  extern char *__progname;
>