Skip to content

Commit 92d06d0

Browse files
committed
Merge pull request #13 from pandax381/fix-typo
Fix typo
2 parents b81d592 + a47abd8 commit 92d06d0

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Since it can not capture SYN/BACK, it can not trace TCP
112112
2: Detect all RST
113113
default is 1
114114

115-
-F, --flagment=[0|1]
115+
-F, --fragment=[0|1]
116116
Detection for IP fragmentation
117117
0: Detection is invalid
118118
1: Detection is valid
@@ -163,7 +163,7 @@ Total Sessions : 0 the number of sessions tracked
163163
Timeout : 0 the number of sessions timeout
164164
Error : 0 the number of error with unable to track
165165
RST : 0 the number of sessions reset by RST
166-
flagment : 0 the number of sessions with IP fragmented
166+
fragment : 0 the number of sessions with IP fragmented
167167
------------------------------
168168
LongConnectTime : 0 [ms] -T option set value
169169
LongDelayTime : 0 [ms] -t option set value

README.ja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ usage: miruo [option] [expression]
4242
-f, --file=file # read file(for tcpdump -w)
4343
-S, --syn=[0|1] # syn retransmit lookup mode.default=1. 0=ignore 1=lookup
4444
-R, --rst=[0|1|2] # rst lookup mode.default=1. (see README)
45-
-F, --flagment=[0|1] # ip flagment lookup. default=1
45+
-F, --fragment=[0|1] # ip fragment lookup. default=1
4646
-C, --color=[0|1] # color 0=off 1=on
4747
-L, --session-limit=NUM # active session limit. Default 1024
4848
-l, --segment-limit=NUM # active segment limit. Default 65536
@@ -117,7 +117,7 @@ expressionにはTCPダンプと同じ書式でフィルタを記述できます
117117
2: 全てのRSTを検出します
118118
デフォルト値は1です。
119119

120-
-F, --flagment=[0|1]
120+
-F, --fragment=[0|1]
121121
IPフラグメントを検出するかどうか指定します。
122122
0: 検出しません。
123123
1: 検出します。
@@ -174,7 +174,7 @@ Total Sessions : 0 追跡したTCPセッションの数
174174
Timeout : 0 タイムアウトしたセッションの数
175175
Error : 0 追跡しきれなくてエラーになった数
176176
RST : 0 RSTでリセットされたセッションの数
177-
flagment : 0 IPフラグメントされたセッションの数
177+
fragment : 0 IPフラグメントされたセッションの数
178178
------------------------------
179179
LongConnectTime : 0 [ms] -Tオプションの設定値
180180
LongDelayTime : 0 [ms] -tオプションの設定値

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
-f, --file=file # read file(for tcpdump -w)
3838
-S, --syn=[0|1] # syn retransmit lookup mode.default=1. 0=ignore 1=lookup
3939
-R, --rst=[0|1|2] # rst lookup mode.default=1. (see README)
40-
-F, --flagment=[0|1] # ip flagment lookup. default=1
40+
-F, --fragment=[0|1] # ip fragment lookup. default=1
4141
-C, --color=[0|1] # color 0=off 1=on
4242
-L, --session-limit=NUM # active session limit. Default 1024
4343
-l, --segment-limit=NUM # active segment limit. Default 65536
@@ -122,7 +122,7 @@
122122
デフォルト値は <code>1</code> です。
123123
</dd>
124124

125-
<dt>-F, --flagment=[0|1]</dt>
125+
<dt>-F, --fragment=[0|1]</dt>
126126
<dd>
127127
IP フラグメントを検出するかどうか指定します。<br/>
128128
<ul>
@@ -181,7 +181,7 @@
181181
Timeout : 0 タイムアウトしたセッションの数
182182
Error : 0 追跡しきれなくてエラーになった数
183183
RST : 0 RSTでリセットされたセッションの数
184-
flagment : 0 IPフラグメントされたセッションの数
184+
fragment : 0 IPフラグメントされたセッションの数
185185
------------------------------
186186
LongConnectTime : 0 [ms] -Tオプションの設定値
187187
LongDelayTime : 0 [ms] -tオプションの設定値

miruo.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void usage()
2727
printf(" -f, --file=file # read file(for tcpdump -w)\n");
2828
printf(" -S, --syn=[0|1] # syn retransmit lookup mode.default=1. 0=ignore 1=lookup\n");
2929
printf(" -R, --rst=[0|1|2] # rst lookup mode.default=1. (see README)\n");
30-
printf(" -F, --flagment=[0|1] # ip flagment lookup. default=1\n");
30+
printf(" -F, --fragment=[0|1] # ip fragment lookup. default=1\n");
3131
printf(" -C, --color=[0|1] # color 0=off 1=on\n");
3232
printf(" -L, --session-limit=NUM # active session limit. Default 1024\n");
3333
printf(" -l, --segment-limit=NUM # active segment limit. Default 65536\n");
@@ -746,11 +746,11 @@ tcpsegment *add_tcpsegment(tcpsession *c, tcpsegment *t)
746746
t->st[0] = c->st[t->sno];
747747
t->st[1] = c->st[t->rno];
748748

749-
if(opt.flagment && (t->flagment & 1)){
749+
if(opt.fragment && (t->fragment & 1)){
750750
c->view = 1;
751751
t->view = 0;
752752
t->color = COLOR_RED;
753-
opt.count_ip_flagment++;
753+
opt.count_ip_fragment++;
754754
}
755755
if((opt.st_limit > 0) && ((get_keika_time(&(p->ts), &(t->ts)) / 1000) > opt.st_limit)){
756756
c->view = 1;
@@ -1028,8 +1028,8 @@ void print_tcpsession(FILE *fp, tcpsession *c)
10281028
}
10291029
t = localtime(&(sg->ts.tv_sec));
10301030
sprintf(ts, "%02d:%02d:%02d.%03u", t->tm_hour, t->tm_min, t->tm_sec, sg->ts.tv_usec / 1000);
1031-
if(opt.flagment){
1032-
if((sg->flagment & 1) != 0){
1031+
if(opt.fragment){
1032+
if((sg->fragment & 1) != 0){
10331033
sprintf(fs, "F");
10341034
}else{
10351035
sprintf(fs, "-");
@@ -1135,7 +1135,7 @@ void miruo_tcpsession_statistics(int view)
11351135
fprintf(stderr, " Timeout : %llu\n", opt.count_ts_timeout);
11361136
fprintf(stderr, " Error : %llu\n", opt.count_ts_error);
11371137
fprintf(stderr, " RST : %llu\n", opt.count_rstbreak + opt.count_rstclose);
1138-
fprintf(stderr, " flagment : %llu\n", opt.count_ip_flagment);
1138+
fprintf(stderr, " fragment : %llu\n", opt.count_ip_fragment);
11391139
fprintf(stderr, "------------------------------\n");
11401140
fprintf(stderr, "LongConnectTime : %d [ms]\n", opt.ct_limit);
11411141
fprintf(stderr, "LongDelayTime : %d [ms]\n", opt.st_limit);
@@ -1604,7 +1604,7 @@ tcpsession *read_tcpsession(tcpsession *c, const struct pcap_pkthdr *ph, const u
16041604
c->ip[1].sin_port = th.dport;
16051605
segment->segsz = ph->len;
16061606
segment->flags = th.flags;
1607-
segment->flagment = th.ip.flags;
1607+
segment->fragment = th.ip.flags;
16081608
segment->seqno = th.seqno;
16091609
segment->ackno = th.ackno;
16101610
segment->optsize = th.offset - 20;
@@ -1857,7 +1857,7 @@ int miruo_init()
18571857
opt.quite = 0;
18581858
opt.promisc = 1;
18591859
opt.viewdata = 0;
1860-
opt.flagment = 1;
1860+
opt.fragment = 1;
18611861
opt.rsynfind = 1;
18621862
opt.rstmode = 1;
18631863
opt.stattime = 0;
@@ -1881,6 +1881,7 @@ struct option *get_optlist()
18811881
"all", 0, NULL, 500,
18821882
"live", 0, NULL, 501,
18831883
"quite", 0, NULL, 'q',
1884+
"fragment", 1, NULL, 'F',
18841885
"flagment", 1, NULL, 'F',
18851886
"color", 1, NULL, 'C',
18861887
"syn", 1, NULL, 'S',
@@ -1925,7 +1926,7 @@ void miruo_setopt(int argc, char *argv[])
19251926
break;
19261927
case 'F':
19271928
if(is_numeric(optarg)){
1928-
opt.flagment = atoi(optarg);
1929+
opt.fragment = atoi(optarg);
19291930
}else{
19301931
usage();
19311932
miruo_finish(1);

miruo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ typedef struct tcpsegment
144144
uint8_t rno; //
145145
uint8_t st[2]; // ステータス
146146
uint8_t flags; // TCPフラグ
147-
uint8_t flagment; // IPフラグメントの状態
147+
uint8_t fragment; // IPフラグメントの状態
148148
uint16_t segsz; // セグメントサイズ
149149
uint16_t segno; // セグメント番号
150150
uint32_t seqno; // シーケンス番号
@@ -222,7 +222,7 @@ typedef struct miruopt
222222
int pksize; // キャプチャサイズ
223223
int promisc; // NICをpromiscにするか
224224
int rstmode; // Rオプションの数
225-
int flagment; // IPのフラグメントを検出するかどうか
225+
int fragment; // IPのフラグメントを検出するかどうか
226226
int viewdata; // ついでに表示しとくデータの数
227227
int rsynfind; // SYNの再送を必ず検出するフラグ
228228
int stattime; // 統計情報を表示する間隔
@@ -253,7 +253,7 @@ typedef struct miruopt
253253
uint64_t count_sg_delay; //
254254
uint64_t count_sg_drop; // TCPセグメントを保持できなかった数
255255
uint64_t count_sg_retrans; // 再送回数
256-
uint64_t count_ip_flagment; //
256+
uint64_t count_ip_fragment; //
257257
uint64_t count_rstbreak; //
258258
uint64_t count_rstclose; //
259259
tcpsession *tsact; //

0 commit comments

Comments
 (0)