📄 set_flow_id
字号:
eval 'exec perl $0 -S ${1+"$@"}' # -*- perl -*- if 0;require 5.001;## set_flow_id.pl# Copyright (C) 1997 by USC/ISI## Derived from# Id: rbp_hack_attr.pl,v 1.1 1997/10/08 20:31:46 johnh Exp # from LSAM Project's rate-based pacing work.## Copyright (c) 1997 University of Southern California.# All rights reserved. # # Redistribution and use in source and binary forms are permitted# provided that the above copyright notice and this paragraph are# duplicated in all such forms and that any documentation, advertising# materials, and other materials related to such distribution and use# acknowledge that the software was developed by the University of# Southern California, Information Sciences Institute. The name of the# University may not be used to endorse or promote products derived from# this software without specific prior written permission.# # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.# sub usage { print STDERR <<END;usage: $0Hack the attribute field in ns trace output to make itbe the source/dest we want.By default, sets the attribute to the minimum of the source or destination.Options: -m take minimum (default) -s take source -d take destinationEND exit 1;}use strict;use Getopt::Long;&usage if ($#ARGV >= 0 && $ARGV[0] eq '-?');my(%opts);&GetOptions(\%opts, qw(m s d));# &usage if ($#ARGV < 0);my($MODE_MIN, $MODE_SRC, $MODE_DEST) = (0..10);my($mode) = $MODE_MIN;$mode = $MODE_MIN if (defined($opts{'m'}));$mode = $MODE_SRC if (defined($opts{'s'}));$mode = $MODE_DEST if (defined($opts{'d'}));while (<>) { if (/^[^-+hdr]/) { print; } else { chomp; my(@f) = split(/ /); my($hacky_src, $hacky_dest) = @f[8,9]; my($src) = split(/\./, $hacky_src); my($dest) = split(/\./, $hacky_dest); my($min) = $src < $dest ? $src : $dest; $f[7] = $min if ($mode == $MODE_MIN); $f[7] = $src if ($mode == $MODE_SRC); $f[7] = $dest if ($mode == $MODE_DEST); print join(" ", @f), "\n"; };}exit 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -