]> granicus.if.org Git - strace/commit
Make getfdproto return enum instead of string
authorFabien Siron <fabien.siron@epita.fr>
Fri, 17 Jun 2016 16:29:53 +0000 (16:29 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 19 Jun 2016 23:01:14 +0000 (23:01 +0000)
commit802cc28f399951da292c1ece6d4fe039470525fa
tree9eb146f6616540c476a07f769f37f3e7b0ff1d0e
parentcb7409c87a1382bd8193ec6e334a400b1e22c302
Make getfdproto return enum instead of string

Introduce a new enum type sock_proto and use it instead of strings for socket
protocols identification.

* defs.h (sock_proto): New enum.
(get_proto_by_name): New function.
* socketutils.c (protocols): New static table.
(print_sockaddr_by_inode): Use it.  Change type of "proto" argument
to sock_proto.
(get_proto_by_name): New function.
* util.c (getfdproto): Use it.  Change return type to sock_proto.
(printfd): Update.
defs.h
socketutils.c
util.c