Script to grep tcp/ip/udp/icmp settings via ndd

Monday, August 30, 2010 at 10:02 PM
#! /bin/ksh
# nddgrep version 0.0.5 - grep tcp/ip/udp/icmp settings via ndd.
# March 28 2003 Sam Nelson
# As usual, not clever or efficient, but quick, dirty and effective.
# tested on Solaris 8 and 9, works ok-ish on 7, 2.6.
# I've moved companies! updated scripts will now be available at http://www.unix.ms

#Set a tmpfile
TMPFILE=nddgrep.txt

echo "Running nddgrep script v0.0.5 Sam Nelson ........"
echo "nddgrep output - for latest version see http://www.unix.ms" >$TMPFILE
# Get uname (useful!)

echo "nddgrep report for host:" >>$TMPFILE
/usr/bin/uname -a >>$TMPFILE

# Get basic TCP / UDP info
echo "netstat -s -P tcp" >>$TMPFILE 2>&1
netstat -s -P tcp >>$TMPFILE 2>&1
echo "netstat -s -P udp" >>$TMPFILE 2>&1
netstat -s -P udp >>$TMPFILE 2>&1

###Get IP stuff

echo "IP settings" >>$TMPFILE

echo /dev/ip/ ip_respond_to_address_mask_broadcast >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_respond_to_address_mask_broadcast >>$TMPFILE 2>&1

echo /dev/ip/ ip_respond_to_echo_broadcast >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_respond_to_echo_broadcast >>$TMPFILE 2>&1

echo /dev/ip/ ip_respond_to_timestamp >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_respond_to_timestamp >>$TMPFILE 2>&1

echo /dev/ip/ ip_respond_to_timestamp_broadcast >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_respond_to_timestamp_broadcast >>$TMPFILE 2>&1

echo /dev/ip/ ip_send_redirects >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_send_redirects >>$TMPFILE 2>&1

echo /dev/ip/ ip_forward_directed_broadcasts >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_forward_directed_broadcasts >>$TMPFILE 2>&1

echo /dev/ip/ ip_debug >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_debug >>$TMPFILE 2>&1

echo /dev/ip/ ip_mrtdebug >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_mrtdebug >>$TMPFILE 2>&1

echo /dev/ip/ ip_ire_timer_interval >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ire_timer_interval >>$TMPFILE 2>&1

echo /dev/ip/ ip_ire_arp_interval >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ire_arp_interval >>$TMPFILE 2>&1

echo /dev/ip/ ip_ire_redirect_interval >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ire_redirect_interval >>$TMPFILE 2>&1

echo /dev/ip/ ip_def_ttl >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_def_ttl >>$TMPFILE 2>&1

echo /dev/ip/ ip_forward_src_routed >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_forward_src_routed >>$TMPFILE 2>&1

echo /dev/ip/ ip_wroff_extra >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_wroff_extra >>$TMPFILE 2>&1

echo /dev/ip/ ip_ire_pathmtu_interval >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ire_pathmtu_interval >>$TMPFILE 2>&1

echo /dev/ip/ ip_icmp_return_data_bytes >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_icmp_return_data_bytes >>$TMPFILE 2>&1

echo /dev/ip/ ip_path_mtu_discovery >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_path_mtu_discovery >>$TMPFILE 2>&1

echo /dev/ip/ ip_ignore_delete_time >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ignore_delete_time >>$TMPFILE 2>&1

echo /dev/ip/ ip_ignore_redirect >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ignore_redirect >>$TMPFILE 2>&1

echo /dev/ip/ ip_output_queue >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_output_queue >>$TMPFILE 2>&1

echo /dev/ip/ ip_broadcast_ttl >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_broadcast_ttl >>$TMPFILE 2>&1

echo /dev/ip/ ip_icmp_err_interval >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_icmp_err_interval >>$TMPFILE 2>&1

echo /dev/ip/ ip_icmp_err_burst >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_icmp_err_burst >>$TMPFILE 2>&1

echo /dev/ip/ ip_reass_queue_bytes >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_reass_queue_bytes >>$TMPFILE 2>&1

echo /dev/ip/ ip_strict_dst_multihoming >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_strict_dst_multihoming >>$TMPFILE 2>&1

echo /dev/ip/ ip_addrs_per_if >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_addrs_per_if >>$TMPFILE 2>&1

echo /dev/ip/ ipsec_override_persocket_policy >>$TMPFILE 2>&1
ndd -get /dev/ip/ ipsec_override_persocket_policy >>$TMPFILE 2>&1

echo /dev/ip/ icmp_accept_clear_messages >>$TMPFILE 2>&1
ndd -get /dev/ip/ icmp_accept_clear_messages >>$TMPFILE 2>&1

echo /dev/ip/ igmp_accept_clear_messages >>$TMPFILE 2>&1
ndd -get /dev/ip/ igmp_accept_clear_messages >>$TMPFILE 2>&1

echo /dev/ip/ ip_ndp_delay_first_probe_time >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ndp_delay_first_probe_time >>$TMPFILE 2>&1

echo /dev/ip/ ip_ndp_max_unicast_solicit >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ndp_max_unicast_solicit >>$TMPFILE 2>&1

echo /dev/ip/ ip6_def_hops >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip6_def_hops >>$TMPFILE 2>&1

echo /dev/ip/ ip6_icmp_return_data_bytes >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip6_icmp_return_data_bytes >>$TMPFILE 2>&1

echo /dev/ip/ ip6_forwarding >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip6_forwarding >>$TMPFILE 2>&1

echo /dev/ip/ ip6_forward_src_routed >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip6_forward_src_routed >>$TMPFILE 2>&1

echo /dev/ip/ ip6_respond_to_echo_multicast >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip6_respond_to_echo_multicast >>$TMPFILE 2>&1

echo /dev/ip/ ip6_send_redirects >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip6_send_redirects >>$TMPFILE 2>&1

echo /dev/ip/ ip6_ignore_redirect >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip6_ignore_redirect >>$TMPFILE 2>&1

echo /dev/ip/ ip6_strict_dst_multihoming >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip6_strict_dst_multihoming >>$TMPFILE 2>&1

echo /dev/ip/ ip_ire_reclaim_fraction >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ire_reclaim_fraction >>$TMPFILE 2>&1

echo /dev/ip/ ipsec_policy_log_interval >>$TMPFILE 2>&1
ndd -get /dev/ip/ ipsec_policy_log_interval >>$TMPFILE 2>&1

echo /dev/ip/ pim_accept_clear_messages >>$TMPFILE 2>&1
ndd -get /dev/ip/ pim_accept_clear_messages >>$TMPFILE 2>&1

echo /dev/ip/ ip_ndp_unsolicit_interval >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ndp_unsolicit_interval >>$TMPFILE 2>&1

echo /dev/ip/ ip_ndp_unsolicit_count >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ndp_unsolicit_count >>$TMPFILE 2>&1

echo /dev/ip/ ip_forwarding >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_forwarding >>$TMPFILE 2>&1

echo /dev/ip/ ip_ill_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ill_status >>$TMPFILE 2>&1

echo /dev/ip/ ip_ipif_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ipif_status >>$TMPFILE 2>&1

echo /dev/ip/ ipv4_ire_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ipv4_ire_status >>$TMPFILE 2>&1

echo /dev/ip/ ipv4_mrtun_ire_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ipv4_mrtun_ire_status >>$TMPFILE 2>&1

echo /dev/ip/ ipv4_srcif_ire_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ipv4_srcif_ire_status >>$TMPFILE 2>&1

echo /dev/ip/ ipv6_ire_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ipv6_ire_status >>$TMPFILE 2>&1

echo /dev/ip/ ip_ipc_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ipc_status >>$TMPFILE 2>&1

echo /dev/ip/ ip_rput_pullups >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_rput_pullups >>$TMPFILE 2>&1

echo /dev/ip/ ip_enable_group_ifs >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_enable_group_ifs >>$TMPFILE 2>&1

echo /dev/ip/ ifgrp_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ifgrp_status >>$TMPFILE 2>&1

echo /dev/ip/ ip_ndp_cache_report >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_ndp_cache_report >>$TMPFILE 2>&1

echo /dev/ip/ ip_proxy_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_proxy_status >>$TMPFILE 2>&1

echo /dev/ip/ ip_srcid_status >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_srcid_status >>$TMPFILE 2>&1

echo /dev/ip/ ip_forwarding >>$TMPFILE 2>&1
ndd -get /dev/ip/ ip_forwarding >>$TMPFILE 2>&1


###Get TCP stuff

echo "TCP settings" >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_time_wait_interval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_time_wait_interval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_conn_req_max_q >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_conn_req_max_q >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_conn_req_max_q0 >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_conn_req_max_q0 >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_conn_req_min >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_conn_req_min >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_conn_grace_period >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_conn_grace_period >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_cwnd_max >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_cwnd_max >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_debug >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_debug >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_smallest_nonpriv_port >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_smallest_nonpriv_port >>$TMPFILE 2>&1

echo /dev/tcp tcp_ip_abort_cinterval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_ip_abort_cinterval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_ip_abort_linterval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_ip_abort_linterval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_ip_abort_interval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_ip_abort_interval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_ip_notify_cinterval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_ip_notify_cinterval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_ip_notify_interval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_ip_notify_interval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_ipv4_ttl >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_ipv4_ttl >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_keepalive_interval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_keepalive_interval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_maxpsz_multiplier >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_maxpsz_multiplier >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_mss_def_ipv4 >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_mss_def_ipv4 >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_mss_max_ipv4 >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_mss_max_ipv4 >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_mss_min >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_mss_min >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_naglim_def >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_naglim_def >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_rexmit_interval_initial >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_rexmit_interval_initial >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_rexmit_interval_max >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_rexmit_interval_max >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_rexmit_interval_min >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_rexmit_interval_min >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_deferred_ack_interval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_deferred_ack_interval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_snd_lowat_fraction >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_snd_lowat_fraction >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_sth_rcv_hiwat >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_sth_rcv_hiwat >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_sth_rcv_lowat >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_sth_rcv_lowat >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_dupack_fast_retransmit >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_dupack_fast_retransmit >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_ignore_path_mtu >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_ignore_path_mtu >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_rcv_push_wait >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_rcv_push_wait >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_smallest_anon_port >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_smallest_anon_port >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_largest_anon_port >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_largest_anon_port >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_xmit_hiwat >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_xmit_hiwat >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_xmit_lowat >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_xmit_lowat >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_recv_hiwat >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_recv_hiwat >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_recv_hiwat_minmss >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_recv_hiwat_minmss >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_fin_wait_2_flush_interval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_fin_wait_2_flush_interval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_co_min >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_co_min >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_max_buf >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_max_buf >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_strong_iss >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_strong_iss >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_rtt_updates >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_rtt_updates >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_wscale_always >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_wscale_always >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_tstamp_always >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_tstamp_always >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_tstamp_if_wscale >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_tstamp_if_wscale >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_rexmit_interval_extra >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_rexmit_interval_extra >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_deferred_acks_max >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_deferred_acks_max >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_slow_start_after_idle >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_slow_start_after_idle >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_slow_start_initial >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_slow_start_initial >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_co_timer_interval >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_co_timer_interval >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_sack_permitted >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_sack_permitted >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_trace >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_trace >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_compression_enabled >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_compression_enabled >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_ipv6_hoplimit >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_ipv6_hoplimit >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_mss_def_ipv6 >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_mss_def_ipv6 >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_mss_max_ipv6 >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_mss_max_ipv6 >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_rev_src_routes >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_rev_src_routes >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_wroff_xtra >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_wroff_xtra >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_extra_priv_ports >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_extra_priv_ports >>$TMPFILE 2>&1
echo /dev/tcp/ tcp_extra_priv_ports_add >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_extra_priv_ports_add >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_extra_priv_ports_del >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_extra_priv_ports_del >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_status >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_status >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_bind_hash >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_bind_hash >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_listen_hash >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_listen_hash >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_conn_hash >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_conn_hash >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_acceptor_hash >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_acceptor_hash >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_host_param >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_host_param >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_time_wait_stats >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_time_wait_stats >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_host_param_ipv6 >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_host_param_ipv6 >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_1948_phrase >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_1948_phrase >>$TMPFILE 2>&1

echo /dev/tcp/ tcp_reserved_port_list >>$TMPFILE 2>&1
ndd -get /dev/tcp tcp_reserved_port_list >>$TMPFILE 2>&1


###And UDP.....

echo "UDP settings" >>$TMPFILE 2>&1

echo /dev/udp udp_wroff_extra >>$TMPFILE 2>&1
ndd -get /dev/udp udp_wroff_extra >>$TMPFILE 2>&1

echo /dev/udp udp_ipv4_ttl >>$TMPFILE 2>&1
ndd -get /dev/udp udp_ipv4_ttl >>$TMPFILE 2>&1

echo /dev/udp udp_ipv6_hoplimit >>$TMPFILE 2>&1
ndd -get /dev/udp udp_ipv6_hoplimit >>$TMPFILE 2>&1

echo /dev/udp udp_smallest_nonpriv_port >>$TMPFILE 2>&1
ndd -get /dev/udp udp_smallest_nonpriv_port >>$TMPFILE 2>&1

echo /dev/udp udp_do_checksum >>$TMPFILE 2>&1
ndd -get /dev/udp udp_do_checksum >>$TMPFILE 2>&1

echo /dev/udp udp_smallest_anon_port >>$TMPFILE 2>&1
ndd -get /dev/udp udp_smallest_anon_port >>$TMPFILE 2>&1

echo /dev/udp udp_largest_anon_port >>$TMPFILE 2>&1
ndd -get /dev/udp udp_largest_anon_port >>$TMPFILE 2>&1

echo /dev/udp udp_xmit_hiwat >>$TMPFILE 2>&1
ndd -get /dev/udp udp_xmit_hiwat >>$TMPFILE 2>&1

echo /dev/udp udp_xmit_lowat >>$TMPFILE 2>&1
ndd -get /dev/udp udp_xmit_lowat >>$TMPFILE 2>&1

echo /dev/udp udp_recv_hiwat >>$TMPFILE 2>&1
ndd -get /dev/udp udp_recv_hiwat >>$TMPFILE 2>&1

echo /dev/udp udp_max_buf >>$TMPFILE 2>&1
ndd -get /dev/udp udp_max_buf >>$TMPFILE 2>&1

echo /dev/udp udp_extra_priv_ports >>$TMPFILE 2>&1
ndd -get /dev/udp udp_extra_priv_ports >>$TMPFILE 2>&1

echo /dev/udp udp_extra_priv_ports_add >>$TMPFILE 2>&1
ndd -get /dev/udp udp_extra_priv_ports_add >>$TMPFILE 2>&1

echo /dev/udp udp_extra_priv_ports_del >>$TMPFILE 2>&1
ndd -get /dev/udp udp_extra_priv_ports_del >>$TMPFILE 2>&1

echo /dev/udp udp_status >>$TMPFILE 2>&1
ndd -get /dev/udp udp_status >>$TMPFILE 2>&1

echo /dev/udp udp_bind_hash >>$TMPFILE 2>&1
ndd -get /dev/udp udp_bind_hash >>$TMPFILE 2>&1

# get ICMP stuff

echo /dev/icmp icmp_wroff_extra >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_wroff_extra >>$TMPFILE 2>&1

echo /dev/icmp icmp_ipv4_ttl >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_ipv4_ttl >>$TMPFILE 2>&1

echo /dev/icmp icmp_ipv6_hoplimit >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_ipv6_hoplimit >>$TMPFILE 2>&1

echo /dev/icmp icmp_bsd_compat >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_bsd_compat >>$TMPFILE 2>&1

echo /dev/icmp icmp_xmit_hiwat >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_xmit_hiwat >>$TMPFILE 2>&1

echo /dev/icmp icmp_xmit_lowat >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_xmit_lowat >>$TMPFILE 2>&1

echo /dev/icmp icmp_recv_hiwat >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_recv_hiwat >>$TMPFILE 2>&1

echo /dev/icmp icmp_max_buf >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_max_buf >>$TMPFILE 2>&1

echo /dev/icmp icmp_status >>$TMPFILE 2>&1
ndd -get /dev/icmp icmp_status >>$TMPFILE 2>&1

echo "OK script finished" >>$TMPFILE 2>&1

echo Check current directory for nddgrep.txt file!

0 comments

Post a Comment

Solaris | Powered by Blogger | Entries (RSS) | Comments (RSS) | Designed by MB Web Design | XML Coded By Cahayabiru.com