Mercurial > illumos > illumos-gate
changeset 13774:80b84226b49f
3065 some functions in the tcp module can be static
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Approved by: Richard Lowe <richlowe@richlowe.net>
author | David Höppner <0xffea@gmail.com> |
---|---|
date | Fri, 17 Aug 2012 14:11:30 -0400 |
parents | 00c2a08cf1bb |
children | 1d7e7613366b |
files | usr/src/uts/common/inet/tcp/tcp_opt_data.c usr/src/uts/common/inet/tcp/tcp_socket.c usr/src/uts/common/inet/tcp/tcp_stats.c usr/src/uts/common/inet/tcp_impl.h usr/src/uts/common/inet/tcp_stats.h |
diffstat | 5 files changed, 16 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/inet/tcp/tcp_opt_data.c Thu Aug 16 13:08:53 2012 -0400 +++ b/usr/src/uts/common/inet/tcp/tcp_opt_data.c Fri Aug 17 14:11:30 2012 -0400 @@ -42,6 +42,8 @@ #include <inet/proto_set.h> #include <inet/tcp_impl.h> +static int tcp_opt_default(queue_t *, int, int, uchar_t *); + /* * Table of all known options handled on a TCP protocol stack. * @@ -306,7 +308,7 @@ * values are maintained by protocol specific code */ /* ARGSUSED */ -int +static int tcp_opt_default(queue_t *q, int level, int name, uchar_t *ptr) { int32_t *i1 = (int32_t *)ptr;
--- a/usr/src/uts/common/inet/tcp/tcp_socket.c Thu Aug 16 13:08:53 2012 -0400 +++ b/usr/src/uts/common/inet/tcp/tcp_socket.c Fri Aug 17 14:11:30 2012 -0400 @@ -54,12 +54,16 @@ static int tcp_listen(sock_lower_handle_t, int, cred_t *); static int tcp_connect(sock_lower_handle_t, const struct sockaddr *, socklen_t, sock_connid_t *, cred_t *); +static int tcp_getpeername(sock_lower_handle_t, struct sockaddr *, + socklen_t *, cred_t *); +static int tcp_getsockname(sock_lower_handle_t, struct sockaddr *, + socklen_t *, cred_t *); static int tcp_getsockopt(sock_lower_handle_t, int, int, void *, socklen_t *, cred_t *); static int tcp_setsockopt(sock_lower_handle_t, int, int, const void *, socklen_t, cred_t *); static int tcp_sendmsg(sock_lower_handle_t, mblk_t *, struct nmsghdr *, - cred_t *cr); + cred_t *); static int tcp_shutdown(sock_lower_handle_t, int, cred_t *); static void tcp_clr_flowctrl(sock_lower_handle_t); static int tcp_ioctl(sock_lower_handle_t, int, intptr_t, int, int32_t *, @@ -334,7 +338,7 @@ } /* ARGSUSED3 */ -int +static int tcp_getpeername(sock_lower_handle_t proto_handle, struct sockaddr *addr, socklen_t *addrlenp, cred_t *cr) { @@ -352,7 +356,7 @@ } /* ARGSUSED3 */ -int +static int tcp_getsockname(sock_lower_handle_t proto_handle, struct sockaddr *addr, socklen_t *addrlenp, cred_t *cr) { @@ -752,6 +756,7 @@ { conn_t *connp; boolean_t isv6 = family == AF_INET6; + if (type != SOCK_STREAM || (family != AF_INET && family != AF_INET6) || (proto != 0 && proto != IPPROTO_TCP)) { *errorp = EPROTONOSUPPORT; @@ -765,7 +770,7 @@ /* * Put the ref for TCP. Ref for IP was already put - * by ipcl_conn_create. Also Make the conn_t globally + * by ipcl_conn_create. Also make the conn_t globally * visible to walkers */ mutex_enter(&connp->conn_lock);
--- a/usr/src/uts/common/inet/tcp/tcp_stats.c Thu Aug 16 13:08:53 2012 -0400 +++ b/usr/src/uts/common/inet/tcp/tcp_stats.c Fri Aug 17 14:11:30 2012 -0400 @@ -36,8 +36,8 @@ #include <inet/kstatcom.h> #include <inet/snmpcom.h> -static int tcp_kstat_update(kstat_t *kp, int rw); -static int tcp_kstat2_update(kstat_t *kp, int rw); +static int tcp_kstat_update(kstat_t *, int); +static int tcp_kstat2_update(kstat_t *, int); static void tcp_sum_mib(tcp_stack_t *, mib2_tcp_t *); static void tcp_add_mib(mib2_tcp_t *, mib2_tcp_t *); @@ -801,7 +801,7 @@ * To add stats from one mib2_tcp_t to another. Static fields are not added. * The caller should set them up propertly. */ -void +static void tcp_add_mib(mib2_tcp_t *from, mib2_tcp_t *to) { to->tcpActiveOpens += from->tcpActiveOpens;
--- a/usr/src/uts/common/inet/tcp_impl.h Thu Aug 16 13:08:53 2012 -0400 +++ b/usr/src/uts/common/inet/tcp_impl.h Fri Aug 17 14:11:30 2012 -0400 @@ -546,10 +546,6 @@ extern void tcp_eager_cleanup(tcp_t *, boolean_t); extern void tcp_eager_kill(void *, mblk_t *, void *, ip_recv_attr_t *); extern void tcp_eager_unlink(tcp_t *); -extern int tcp_getpeername(sock_lower_handle_t, struct sockaddr *, - socklen_t *, cred_t *); -extern int tcp_getsockname(sock_lower_handle_t, struct sockaddr *, - socklen_t *, cred_t *); extern void tcp_init_values(tcp_t *, tcp_t *); extern void tcp_ipsec_cleanup(tcp_t *); extern int tcp_maxpsz_set(tcp_t *, boolean_t); @@ -679,7 +675,6 @@ /* * TCP option processing related functions in tcp_opt_data.c */ -extern int tcp_opt_default(queue_t *, t_scalar_t, t_scalar_t, uchar_t *); extern int tcp_opt_get(conn_t *, int, int, uchar_t *); extern int tcp_opt_set(conn_t *, uint_t, int, int, uint_t, uchar_t *, uint_t *, uchar_t *, void *, cred_t *);
--- a/usr/src/uts/common/inet/tcp_stats.h Thu Aug 16 13:08:53 2012 -0400 +++ b/usr/src/uts/common/inet/tcp_stats.h Fri Aug 17 14:11:30 2012 -0400 @@ -48,7 +48,7 @@ * * TCP_DBGSTAT(name) does atomic increment of a named stat counter. It is * supposed to be used for DEBUG purposes and may be used on a hot path. - * These counters are only available in a debugged kerel. They are grouped + * These counters are only available in a debugged kernel. They are grouped * under the TCP_DEBUG_COUNTER C pre-processor condition. * * Both TCP_STAT and TCP_DBGSTAT counters are available using kstat