Lines Matching refs:acp

75 #define	TCP_AC_V4LADDR(acp) ((sin_t *)&(acp)->ac_local)
76 #define TCP_AC_V4RADDR(acp) ((sin_t *)&(acp)->ac_remote)
77 #define TCP_AC_V4LOCAL(acp) (TCP_AC_V4LADDR(acp)->sin_addr.s_addr)
78 #define TCP_AC_V4REMOTE(acp) (TCP_AC_V4RADDR(acp)->sin_addr.s_addr)
79 #define TCP_AC_V4LPORT(acp) (TCP_AC_V4LADDR(acp)->sin_port)
80 #define TCP_AC_V4RPORT(acp) (TCP_AC_V4RADDR(acp)->sin_port)
81 #define TCP_AC_V6LADDR(acp) ((sin6_t *)&(acp)->ac_local)
82 #define TCP_AC_V6RADDR(acp) ((sin6_t *)&(acp)->ac_remote)
83 #define TCP_AC_V6LOCAL(acp) (TCP_AC_V6LADDR(acp)->sin6_addr)
84 #define TCP_AC_V6REMOTE(acp) (TCP_AC_V6RADDR(acp)->sin6_addr)
85 #define TCP_AC_V6LPORT(acp) (TCP_AC_V6LADDR(acp)->sin6_port)
86 #define TCP_AC_V6RPORT(acp) (TCP_AC_V6RADDR(acp)->sin6_port)
115 * Check if a tcp structure matches the info in acp.
117 #define TCP_AC_ADDR_MATCH(acp, connp, tcp) \
118 (((acp)->ac_local.ss_family == AF_INET) ? \
119 ((TCP_AC_V4LOCAL((acp)) == INADDR_ANY || \
120 TCP_AC_V4LOCAL((acp)) == (connp)->conn_laddr_v4) && \
121 (TCP_AC_V4REMOTE((acp)) == INADDR_ANY || \
122 TCP_AC_V4REMOTE((acp)) == (connp)->conn_faddr_v4) && \
123 (TCP_AC_V4LPORT((acp)) == 0 || \
124 TCP_AC_V4LPORT((acp)) == (connp)->conn_lport) && \
125 (TCP_AC_V4RPORT((acp)) == 0 || \
126 TCP_AC_V4RPORT((acp)) == (connp)->conn_fport) && \
127 (acp)->ac_start <= (tcp)->tcp_state && \
128 (acp)->ac_end >= (tcp)->tcp_state) : \
129 ((IN6_IS_ADDR_UNSPECIFIED(&TCP_AC_V6LOCAL((acp))) || \
130 IN6_ARE_ADDR_EQUAL(&TCP_AC_V6LOCAL((acp)), \
132 (IN6_IS_ADDR_UNSPECIFIED(&TCP_AC_V6REMOTE((acp))) || \
133 IN6_ARE_ADDR_EQUAL(&TCP_AC_V6REMOTE((acp)), \
135 (TCP_AC_V6LPORT((acp)) == 0 || \
136 TCP_AC_V6LPORT((acp)) == (connp)->conn_lport) && \
137 (TCP_AC_V6RPORT((acp)) == 0 || \
138 TCP_AC_V6RPORT((acp)) == (connp)->conn_fport) && \
139 (acp)->ac_start <= (tcp)->tcp_state && \
140 (acp)->ac_end >= (tcp)->tcp_state))
142 #define TCP_AC_MATCH(acp, connp, tcp) \
143 (((acp)->ac_zoneid == ALL_ZONES || \
144 (acp)->ac_zoneid == (connp)->conn_zoneid) ? \
145 TCP_AC_ADDR_MATCH(acp, connp, tcp) : 0)
149 * which is filled in with information from acp and tp.
152 tcp_ioctl_abort_build_msg(tcp_ioc_abort_conn_t *acp, tcp_t *tp)
157 mp = allocb(sizeof (uint32_t) + sizeof (*acp), BPRI_LO);
165 tacp->ac_start = acp->ac_start;
166 tacp->ac_end = acp->ac_end;
167 tacp->ac_zoneid = acp->ac_zoneid;
169 if (acp->ac_local.ss_family == AF_INET) {
184 mp->b_wptr = (uchar_t *)mp->b_rptr + sizeof (uint32_t) + sizeof (*acp);
192 tcp_ioctl_abort_dump(tcp_ioc_abort_conn_t *acp)
200 af = acp->ac_local.ss_family;
203 (void) inet_ntop(af, (const void *)&TCP_AC_V4LOCAL(acp),
205 (void) inet_ntop(af, (const void *)&TCP_AC_V4REMOTE(acp),
207 lport = ntohs(TCP_AC_V4LPORT(acp));
208 rport = ntohs(TCP_AC_V4RPORT(acp));
210 (void) inet_ntop(af, (const void *)&TCP_AC_V6LOCAL(acp),
212 (void) inet_ntop(af, (const void *)&TCP_AC_V6REMOTE(acp),
214 lport = ntohs(TCP_AC_V6LPORT(acp));
215 rport = ntohs(TCP_AC_V6RPORT(acp));
223 if (acp->ac_zoneid == GLOBAL_ZONEID || acp->ac_zoneid == ALL_ZONES)
228 acp->ac_start, acp->ac_end);
234 * Note that when we get here there is no wildcard in acp any more.
243 tcp_ioc_abort_conn_t *acp;
259 acp = (tcp_ioc_abort_conn_t *)(mp->b_rptr + sizeof (uint32_t));
260 if (tcp->tcp_state <= acp->ac_end) {
280 tcp_ioctl_abort_bucket(tcp_ioc_abort_conn_t *acp, int index, int *count,
304 if (TCP_AC_MATCH(acp, tconnp, tcp)) {
306 mp = tcp_ioctl_abort_build_msg(acp, tcp);
349 * Abort all connections that matches the attributes specified in acp.
352 tcp_ioctl_abort(tcp_ioc_abort_conn_t *acp, tcp_stack_t *tcps)
363 af = acp->ac_local.ss_family;
366 if (TCP_AC_V4REMOTE(acp) != INADDR_ANY &&
367 TCP_AC_V4LPORT(acp) != 0 && TCP_AC_V4RPORT(acp) != 0) {
369 pports[1] = TCP_AC_V4LPORT(acp);
370 pports[0] = TCP_AC_V4RPORT(acp);
371 exact = (TCP_AC_V4LOCAL(acp) != INADDR_ANY);
374 if (!IN6_IS_ADDR_UNSPECIFIED(&TCP_AC_V6REMOTE(acp)) &&
375 TCP_AC_V6LPORT(acp) != 0 && TCP_AC_V6RPORT(acp) != 0) {
377 pports[1] = TCP_AC_V6LPORT(acp);
378 pports[0] = TCP_AC_V6RPORT(acp);
379 exact = !IN6_IS_ADDR_UNSPECIFIED(&TCP_AC_V6LOCAL(acp));
388 err = tcp_ioctl_abort_bucket(acp, index,
397 err = tcp_ioctl_abort_bucket(acp, index,
409 if (acp->ac_zoneid == GLOBAL_ZONEID || acp->ac_zoneid == ALL_ZONES)
428 tcp_ioc_abort_conn_t *acp;
454 acp = (tcp_ioc_abort_conn_t *)mp1->b_rptr;
455 laf = acp->ac_local.ss_family;
456 raf = acp->ac_remote.ss_family;
459 if (acp->ac_zoneid != GLOBAL_ZONEID && acp->ac_zoneid != ALL_ZONES) {
474 acp->ac_zoneid = GLOBAL_ZONEID;
476 if (acp->ac_start < TCPS_SYN_SENT || acp->ac_end > TCPS_TIME_WAIT ||
477 acp->ac_start > acp->ac_end || laf != raf ||
483 tcp_ioctl_abort_dump(acp);
484 err = tcp_ioctl_abort(acp, tcps);