summaryrefslogtreecommitdiff
path: root/flowtop.zsh
blob: c43074854368412c88259d3bc786fc33290b57a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#compdef flowtop
#
# flowtop.zsh -- zsh completion function for flowtop
#
# Copyright (C) 2013 Hideo Hattori <hhatto.jp@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

typeset -A opt_args

_arguments -s -S \
    "(-4 --ipv4)"{-4,--ipv4}"[Show only IPv4 flows (default)]" \
    "(-6 --ipv6)"{-6,--ipv6}"[Show only IPv6 flows (default)]" \
    "(-T --tcp)"{-T,--tcp}"[Show only TCP flows (default)]" \
    "(-U --udp)"{-U,--udp}"[Show only UDP flows]" \
    "(-D --dccp)"{-D,--dccp}"[Show only DCCP flows]" \
    "(-I --icmp)"{-I,--icmp}"[Show only ICMP/ICMPv6 flows]" \
    "(-S --sctp)"{-S,--sctp}"[Show only SCTP flows]" \
    "(-n --no-dns)"{-n,--no-dns}"[Don't perform hostname lookup]" \
    "(-G --no-geoip)"{-G,--no-geoip}"[Don't perform GeoIPlookup]" \
    "(-s --show-src)"{-s,--show-src}"[Also show source, not only dest]" \
    "(-b --bits)"{-b,--bits}"[Show rates in bits/s instead of bytes/s]" \
    "(-u --update)"{-u,--update}"[Update GeoIP databases]" \
    "(-t --interval)"{-t,--interval}"[Refresh time in seconds (def: 1s)]:interval:_gnu_generic" \
    {-v,--version}"[Print version and exit]:" \
    {-h,--help}"[Print help and exit]:" \
    "*::args:_gnu_generic"
) paths on t_conn_lock.
An arbitration scheme for duelling SYNs is implemented as part of commit 241b271952eb ("RDS-TCP: Reset tcp callbacks if re-using an outgoing socket in rds_tcp_accept_one()") which ensures that both nodes involved will arrive at the same arbitration decision. However, this needs to be synchronized with an outgoing SYN to be generated by rds_tcp_conn_connect(). This commit achieves the synchronization through the t_conn_lock mutex in struct rds_tcp_connection. The rds_conn_state is checked in rds_tcp_conn_connect() after acquiring the t_conn_lock mutex. A SYN is sent out only if the RDS connection is not already UP (an UP would indicate that rds_tcp_accept_one() has completed 3WH, so no SYN needs to be generated). Similarly, the rds_conn_state is checked in rds_tcp_accept_one() after acquiring the t_conn_lock mutex. The only acceptable states (to allow continuation of the arbitration logic) are UP (i.e., outgoing SYN was SYN-ACKed by peer after it sent us the SYN) or CONNECTING (we sent outgoing SYN before we saw incoming SYN). Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat