]> granicus.if.org Git - strace/commitdiff
Provide a value for arp_hardware_types_size array
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 7 May 2018 06:52:30 +0000 (08:52 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 4 Jun 2018 16:18:14 +0000 (16:18 +0000)
* defs.h (arp_hardware_types_size): New declaration.
* sockaddr.c (arp_hardware_types_size): New variable.

defs.h
sockaddr.c

diff --git a/defs.h b/defs.h
index ea918017505f24b2d537317a00662ec7e367286f..27a865ac5ec1ac3e64651d08ea703fb457a0fa30 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -289,7 +289,12 @@ struct tcb {
 #include "xlat.h"
 
 extern const struct xlat addrfams[];
+
+/** Protocol hardware identifiers array, sorted, defined in sockaddr.c. */
 extern const struct xlat arp_hardware_types[];
+/** Protocol hardware identifiers array size without terminating record. */
+extern const size_t arp_hardware_types_size;
+
 extern const struct xlat at_flags[];
 extern const struct xlat clocknames[];
 extern const struct xlat dirent_types[];
index 0d5975393768b3fffbddcd4df76c8c5076e30094..cfc26cbc35219e10e295c719dccf4a10ed7739b9 100644 (file)
@@ -61,6 +61,7 @@
 
 #define SIZEOF_SA_FAMILY sizeof(((struct sockaddr *) 0)->sa_family)
 
+const size_t arp_hardware_types_size = ARRAY_SIZE(arp_hardware_types) - 1;
 const size_t ethernet_protocols_size = ARRAY_SIZE(ethernet_protocols) - 1;
 
 static void