1 | /*
|
---|
2 | * TINET (TCP/IP Protocol Stack)
|
---|
3 | *
|
---|
4 | * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering
|
---|
5 | * Tomakomai National College of Technology, JAPAN
|
---|
6 | *
|
---|
7 | * 上記著作権者は,以下の (1)~(4) の条件か,Free Software Foundation
|
---|
8 | * によって公表されている GNU General Public License の Version 2 に記
|
---|
9 | * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
|
---|
10 | * を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
|
---|
11 | * 利用と呼ぶ)することを無償で許諾する.
|
---|
12 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
13 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
14 | * スコード中に含まれていること.
|
---|
15 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
16 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
17 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
18 | * の無保証規定を掲載すること.
|
---|
19 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
20 | * 用できない形で再配布する場合には,次の条件を満たすこと.
|
---|
21 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
22 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
23 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
24 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
25 | *
|
---|
26 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
27 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
|
---|
28 | * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
|
---|
29 | * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
|
---|
30 | *
|
---|
31 | * @(#) $Id$
|
---|
32 | */
|
---|
33 |
|
---|
34 | /*
|
---|
35 | * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
|
---|
36 | * The Regents of the University of California. All rights reserved.
|
---|
37 | *
|
---|
38 | * Redistribution and use in source and binary forms, with or without
|
---|
39 | * modification, are permitted provided that the following conditions
|
---|
40 | * are met:
|
---|
41 | * 1. Redistributions of source code must retain the above copyright
|
---|
42 | * notice, this list of conditions and the following disclaimer.
|
---|
43 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
44 | * notice, this list of conditions and the following disclaimer in the
|
---|
45 | * documentation and/or other materials provided with the distribution.
|
---|
46 | * 3. All advertising materials mentioning features or use of this software
|
---|
47 | * must display the following acknowledgement:
|
---|
48 | * This product includes software developed by the University of
|
---|
49 | * California, Berkeley and its contributors.
|
---|
50 | * 4. Neither the name of the University nor the names of its contributors
|
---|
51 | * may be used to endorse or promote products derived from this software
|
---|
52 | * without specific prior written permission.
|
---|
53 | *
|
---|
54 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
---|
55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
---|
57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
---|
58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
---|
60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
---|
61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
---|
63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
64 | * SUCH DAMAGE.
|
---|
65 | */
|
---|
66 |
|
---|
67 | #ifndef _NET_COUNT_H_
|
---|
68 | #define _NET_COUNT_H_
|
---|
69 |
|
---|
70 | /*
|
---|
71 | * ネットワーク統計情報の計測
|
---|
72 | */
|
---|
73 |
|
---|
74 | #if NET_COUNT_ENABLE != 0
|
---|
75 |
|
---|
76 | #ifndef _MACRO_ONLY
|
---|
77 |
|
---|
78 | #ifdef _int64_
|
---|
79 | typedef uint64_t T_NET_COUNT_VAL;
|
---|
80 | #else
|
---|
81 | typedef uint32_t T_NET_COUNT_VAL;
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | typedef struct t_net_count {
|
---|
85 | T_NET_COUNT_VAL in_octets; /* 受信オクテット数 */
|
---|
86 | T_NET_COUNT_VAL out_octets; /* 送信オクテット数 */
|
---|
87 | T_NET_COUNT_VAL in_packets; /* 受信バケット数 */
|
---|
88 | T_NET_COUNT_VAL out_packets; /* 送信バケット数 */
|
---|
89 | T_NET_COUNT_VAL in_err_packets; /* 受信エラーバケット数 */
|
---|
90 | T_NET_COUNT_VAL out_err_packets; /* 送信エラーバケット数 */
|
---|
91 | } T_NET_COUNT;
|
---|
92 |
|
---|
93 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
94 |
|
---|
95 | #endif /* of #if NET_COUNT_ENABLE != 0 */
|
---|
96 |
|
---|
97 | #ifdef SUPPORT_PPP
|
---|
98 |
|
---|
99 | /* PPP */
|
---|
100 |
|
---|
101 | #if NET_COUNT_ENABLE & PROTO_FLG_PPP
|
---|
102 |
|
---|
103 | #define NET_COUNT_PPP(v,c) ((v)+=(c))
|
---|
104 |
|
---|
105 | #ifndef _MACRO_ONLY
|
---|
106 |
|
---|
107 | extern T_NET_COUNT net_count_ppp;
|
---|
108 | extern T_NET_COUNT_VAL net_count_ppp_no_bufs; /* net_buf 割り当て失敗数 */
|
---|
109 |
|
---|
110 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
111 |
|
---|
112 | #define NC_PPP_SIZE 7 /* カウンタ数 */
|
---|
113 |
|
---|
114 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP */
|
---|
115 |
|
---|
116 | #define NET_COUNT_PPP(v,c)
|
---|
117 |
|
---|
118 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP */
|
---|
119 |
|
---|
120 | /* PPP HDLC */
|
---|
121 |
|
---|
122 | #if NET_COUNT_ENABLE & PROTO_FLG_PPP_HDLC
|
---|
123 |
|
---|
124 | #define NET_COUNT_PPP_HDLC(v,c) ((v)+=(c))
|
---|
125 |
|
---|
126 | #ifndef _MACRO_ONLY
|
---|
127 |
|
---|
128 | extern T_NET_COUNT net_count_hdlc;
|
---|
129 |
|
---|
130 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
131 |
|
---|
132 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_HDLC */
|
---|
133 |
|
---|
134 | #define NET_COUNT_PPP_HDLC(v,c)
|
---|
135 |
|
---|
136 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_HDLC */
|
---|
137 |
|
---|
138 | /* PPP LCP */
|
---|
139 |
|
---|
140 | #if NET_COUNT_ENABLE & PROTO_FLG_PPP_LCP
|
---|
141 |
|
---|
142 | #define NET_COUNT_PPP_LCP(v,c) ((v)+=(c))
|
---|
143 |
|
---|
144 | #ifndef _MACRO_ONLY
|
---|
145 |
|
---|
146 | extern T_NET_COUNT_VAL net_count_ppp_lcp_in_octets;
|
---|
147 | extern T_NET_COUNT_VAL net_count_ppp_lcp_in_packets;
|
---|
148 |
|
---|
149 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
150 |
|
---|
151 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_LCP */
|
---|
152 |
|
---|
153 | #define NET_COUNT_PPP_LCP(v,c)
|
---|
154 |
|
---|
155 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_LCP */
|
---|
156 |
|
---|
157 | /* PPP IPV6CP */
|
---|
158 |
|
---|
159 | #if NET_COUNT_ENABLE & PROTO_FLG_PPP_IPV6CP
|
---|
160 |
|
---|
161 | #define NET_COUNT_PPP_IPV6CP(v,c) ((v)+=(c))
|
---|
162 |
|
---|
163 | #ifndef _MACRO_ONLY
|
---|
164 |
|
---|
165 | extern T_NET_COUNT_VAL net_count_ppp_ipv6cp_in_octets;
|
---|
166 | extern T_NET_COUNT_VAL net_count_ppp_ipv6cp_in_packets;
|
---|
167 |
|
---|
168 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
169 |
|
---|
170 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_IPV6CP */
|
---|
171 |
|
---|
172 | #define NET_COUNT_PPP_IPV6CP(v,c)
|
---|
173 |
|
---|
174 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_IPV6CP */
|
---|
175 |
|
---|
176 | /* PPP IPCP */
|
---|
177 |
|
---|
178 | #if NET_COUNT_ENABLE & PROTO_FLG_PPP_IPCP
|
---|
179 |
|
---|
180 | #define NET_COUNT_PPP_IPCP(v,c) ((v)+=(c))
|
---|
181 |
|
---|
182 | #ifndef _MACRO_ONLY
|
---|
183 |
|
---|
184 | extern T_NET_COUNT_VAL net_count_ppp_ipcp_in_octets;
|
---|
185 | extern T_NET_COUNT_VAL net_count_ppp_ipcp_in_packets;
|
---|
186 |
|
---|
187 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
188 |
|
---|
189 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_IPCP */
|
---|
190 |
|
---|
191 | #define NET_COUNT_PPP_IPCP(v,c)
|
---|
192 |
|
---|
193 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_IPCP */
|
---|
194 |
|
---|
195 | /* PPP CCP */
|
---|
196 |
|
---|
197 | #if NET_COUNT_ENABLE & PROTO_FLG_PPP_CCP
|
---|
198 |
|
---|
199 | #define NET_COUNT_PPP_CCP(v,c) ((v)+=(c))
|
---|
200 |
|
---|
201 | #ifndef _MACRO_ONLY
|
---|
202 |
|
---|
203 | extern T_NET_COUNT_VAL net_count_ppp_ccp_in_octets;
|
---|
204 | extern T_NET_COUNT_VAL net_count_ppp_ccp_in_packets;
|
---|
205 |
|
---|
206 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
207 |
|
---|
208 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_CCP */
|
---|
209 |
|
---|
210 | #define NET_COUNT_PPP_CCP(v,c)
|
---|
211 |
|
---|
212 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_CCP */
|
---|
213 |
|
---|
214 | /* PPP PAP */
|
---|
215 |
|
---|
216 | #if NET_COUNT_ENABLE & PROTO_FLG_PPP_PAP
|
---|
217 |
|
---|
218 | #define NET_COUNT_PPP_PAP(v,c) ((v)+=(c))
|
---|
219 |
|
---|
220 | #ifndef _MACRO_ONLY
|
---|
221 |
|
---|
222 | extern T_NET_COUNT_VAL net_count_ppp_upap_in_octets;
|
---|
223 | extern T_NET_COUNT_VAL net_count_ppp_upap_in_packets;
|
---|
224 |
|
---|
225 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
226 |
|
---|
227 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_PAP */
|
---|
228 |
|
---|
229 | #define NET_COUNT_PPP_PAP(v,c)
|
---|
230 |
|
---|
231 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_PPP_PAP */
|
---|
232 |
|
---|
233 | #endif /* of #ifdef SUPPORT_PPP */
|
---|
234 |
|
---|
235 | #ifdef SUPPORT_LOOP
|
---|
236 |
|
---|
237 | /* ループバック */
|
---|
238 |
|
---|
239 | #if NET_COUNT_ENABLE & PROTO_FLG_LOOP
|
---|
240 |
|
---|
241 | #define NET_COUNT_LOOP(v,c) ((v)+=(c))
|
---|
242 |
|
---|
243 | #ifndef _MACRO_ONLY
|
---|
244 |
|
---|
245 | extern T_NET_COUNT net_count_loop;
|
---|
246 |
|
---|
247 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
248 |
|
---|
249 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_LOOP */
|
---|
250 |
|
---|
251 | #define NET_COUNT_LOOP(v,c)
|
---|
252 |
|
---|
253 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_LOOP */
|
---|
254 |
|
---|
255 | #endif /* of #ifdef SUPPORT_LOOP */
|
---|
256 |
|
---|
257 | #ifdef SUPPORT_ETHER
|
---|
258 |
|
---|
259 | /* Ethernet */
|
---|
260 |
|
---|
261 | #if NET_COUNT_ENABLE & PROTO_FLG_ETHER
|
---|
262 |
|
---|
263 | #define NET_COUNT_ETHER(v,c) ((v)+=(c))
|
---|
264 |
|
---|
265 | #ifndef _MACRO_ONLY
|
---|
266 |
|
---|
267 | extern T_NET_COUNT net_count_ether;
|
---|
268 |
|
---|
269 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
270 |
|
---|
271 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_ETHER */
|
---|
272 |
|
---|
273 | #define NET_COUNT_ETHER(v,c)
|
---|
274 |
|
---|
275 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_ETHER */
|
---|
276 |
|
---|
277 | /* NIC (if_ed) */
|
---|
278 |
|
---|
279 | #if NET_COUNT_ENABLE & PROTO_FLG_ETHER_NIC
|
---|
280 |
|
---|
281 | #define NC_ETHER_NIC_RESETS 0 /* リセット数 */
|
---|
282 | #define NC_ETHER_NIC_TXB_QOVRS 1 /* 送信セマフォ資源返却上限オーバー数*/
|
---|
283 | #define NC_ETHER_NIC_TIMEOUTS 2 /* 送信タイムアウト数 */
|
---|
284 | #define NC_ETHER_NIC_COLS 3 /* コリジョン数 */
|
---|
285 | #define NC_ETHER_NIC_OUT_ERR_PACKETS 4 /* 送信エラーバケット数 */
|
---|
286 | #define NC_ETHER_NIC_OUT_PACKETS 5 /* 送信バケット数 */
|
---|
287 | #define NC_ETHER_NIC_OUT_OCTETS 6 /* 送信オクテット数 */
|
---|
288 | #define NC_ETHER_NIC_RXB_QOVRS 7 /* 受信セマフォ資源返却上限オーバー数*/
|
---|
289 | #define NC_ETHER_NIC_NO_BUFS 8 /* net_buf 割り当て失敗数 */
|
---|
290 | #define NC_ETHER_NIC_IN_ERR_PACKETS 9 /* 受信エラーバケット数 */
|
---|
291 | #define NC_ETHER_NIC_IN_PACKETS 10 /* 受信バケット数 */
|
---|
292 | #define NC_ETHER_NIC_IN_OCTETS 11 /* 受信オクテット数 */
|
---|
293 | #define NC_ETHER_NIC_SIZE 12 /* カウンタ数 */
|
---|
294 |
|
---|
295 | #define NET_COUNT_ETHER_NIC(v,c) ((v)+=(c))
|
---|
296 |
|
---|
297 | #ifndef _MACRO_ONLY
|
---|
298 |
|
---|
299 | extern T_NET_COUNT_VAL net_count_ether_nic[NC_ETHER_NIC_SIZE];
|
---|
300 |
|
---|
301 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
302 |
|
---|
303 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_ETHER_NIC */
|
---|
304 |
|
---|
305 | #define NET_COUNT_ETHER_NIC(v,c)
|
---|
306 |
|
---|
307 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_ETHER_NIC */
|
---|
308 |
|
---|
309 | #endif /* of #ifdef SUPPORT_ETHER */
|
---|
310 |
|
---|
311 | /* ネットワークバッファ */
|
---|
312 |
|
---|
313 | #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF
|
---|
314 |
|
---|
315 | #define NET_COUNT_NET_BUF(v,c) ((v)+=(c))
|
---|
316 |
|
---|
317 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF */
|
---|
318 |
|
---|
319 | #define NET_COUNT_NET_BUF(v,c)
|
---|
320 |
|
---|
321 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_NET_BUF */
|
---|
322 |
|
---|
323 | #if defined(_IP4_CFG)
|
---|
324 |
|
---|
325 | /* ARP */
|
---|
326 |
|
---|
327 | #if NET_COUNT_ENABLE & PROTO_FLG_ARP
|
---|
328 |
|
---|
329 | #define NET_COUNT_ARP(v,c) ((v)+=(c))
|
---|
330 |
|
---|
331 | #ifndef _MACRO_ONLY
|
---|
332 |
|
---|
333 | extern T_NET_COUNT net_count_arp;
|
---|
334 |
|
---|
335 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
336 |
|
---|
337 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_ARP */
|
---|
338 |
|
---|
339 | #define NET_COUNT_ARP(v,c)
|
---|
340 |
|
---|
341 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_ARP */
|
---|
342 |
|
---|
343 | /* IPv4 */
|
---|
344 |
|
---|
345 | #if NET_COUNT_ENABLE & PROTO_FLG_IP4
|
---|
346 |
|
---|
347 | #define NC_IP4_FRAG_OUT_FRAGS 0 /* 分割送信、フラグメント数 */
|
---|
348 | #define NC_IP4_FRAG_OUT 1 /* 分割送信数 */
|
---|
349 | #define NC_IP4_OUT_ERR_PACKETS 2 /* 送信エラーデータグラム数 */
|
---|
350 | #define NC_IP4_OUT_PACKETS 3 /* 送信データグラム数 */
|
---|
351 | #define NC_IP4_OUT_OCTETS 4 /* 送信オクテット数 */
|
---|
352 | #define NC_IP4_FRAG_IN_TMOUT 5 /* 分割受信タイムアウト数 */
|
---|
353 | #define NC_IP4_FRAG_IN_NO_BUF 6 /* 分割受信バッファり当て失敗数 */
|
---|
354 | #define NC_IP4_FRAG_IN_DROP 7 /* 分割受信破棄数 */
|
---|
355 | #define NC_IP4_FRAG_IN_OK 8 /* 分割受信再構成成功数 */
|
---|
356 | #define NC_IP4_FRAG_IN_FRAGS 9 /* 分割受信フラグメント数 */
|
---|
357 | #define NC_IP4_FRAG_IN 10 /* 分割受信数 */
|
---|
358 | #define NC_IP4_OPTS 11 /* オプション入力数 */
|
---|
359 | #define NC_IP4_IN_ERR_PROTO 12 /* プロトコルエラー数 */
|
---|
360 | #define NC_IP4_IN_ERR_ADDR 13 /* アドレスエラー数 */
|
---|
361 | #define NC_IP4_IN_ERR_VER 14 /* バージョンエラー数 */
|
---|
362 | #define NC_IP4_IN_ERR_SHORT 15 /* 長さエラー数 */
|
---|
363 | #define NC_IP4_IN_ERR_CKSUM 16 /* チェックサムエラー数 */
|
---|
364 | #define NC_IP4_IN_ERR_PACKETS 17 /* 受信エラーデータグラム数 */
|
---|
365 | #define NC_IP4_IN_PACKETS 18 /* 受信データグラム数 */
|
---|
366 | #define NC_IP4_IN_OCTETS 19 /* 受信オクテット数 */
|
---|
367 | #define NC_IP4_SIZE 20 /* カウンタ数 */
|
---|
368 |
|
---|
369 | #define NET_COUNT_IP4(v,c) ((v)+=(c))
|
---|
370 |
|
---|
371 | #ifndef _MACRO_ONLY
|
---|
372 |
|
---|
373 | extern T_NET_COUNT_VAL net_count_ip4[NC_IP4_SIZE];
|
---|
374 |
|
---|
375 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
376 |
|
---|
377 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_IP4 */
|
---|
378 |
|
---|
379 | #define NET_COUNT_IP4(v,c)
|
---|
380 |
|
---|
381 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_IP4 */
|
---|
382 |
|
---|
383 | /* ICMP4 */
|
---|
384 |
|
---|
385 | #if NET_COUNT_ENABLE & PROTO_FLG_ICMP4
|
---|
386 |
|
---|
387 | #define NET_COUNT_ICMP4(v,c) ((v)+=(c))
|
---|
388 |
|
---|
389 | #ifndef _MACRO_ONLY
|
---|
390 |
|
---|
391 | extern T_NET_COUNT net_count_icmp4;
|
---|
392 |
|
---|
393 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
394 |
|
---|
395 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_ICMP4 */
|
---|
396 |
|
---|
397 | #define NET_COUNT_ICMP4(v,c)
|
---|
398 |
|
---|
399 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_ICMP4 */
|
---|
400 |
|
---|
401 | #endif /* of #if defined(_IP4_CFG) */
|
---|
402 |
|
---|
403 | #if defined(_IP6_CFG)
|
---|
404 |
|
---|
405 | /* IPv6 */
|
---|
406 |
|
---|
407 | #if NET_COUNT_ENABLE & PROTO_FLG_IP6
|
---|
408 |
|
---|
409 | #define NC_IP6_FRAG_OUT_FRAGS 0 /* 分割送信、フラグメント数 */
|
---|
410 | #define NC_IP6_FRAG_OUT 1 /* 分割送信数 */
|
---|
411 | #define NC_IP6_OUT_ERR_PACKETS 2 /* 送信エラーデータグラム数 */
|
---|
412 | #define NC_IP6_OUT_PACKETS 3 /* 送信データグラム数 */
|
---|
413 | #define NC_IP6_OUT_OCTETS 4 /* 送信オクテット数 */
|
---|
414 | #define NC_IP6_FRAG_IN_TMOUT 5 /* 分割受信タイムアウト数 */
|
---|
415 | #define NC_IP6_FRAG_IN_NO_BUF 6 /* 分割受信バッファり当て失敗数 */
|
---|
416 | #define NC_IP6_FRAG_IN_DROP 7 /* 分割受信破棄数 */
|
---|
417 | #define NC_IP6_FRAG_IN_OK 8 /* 分割受信再構成成功数 */
|
---|
418 | #define NC_IP6_FRAG_IN_FRAGS 9 /* 分割受信フラグメント数 */
|
---|
419 | #define NC_IP6_FRAG_IN 10 /* 分割受信数 */
|
---|
420 | #define NC_IP6_IN_ERR_PROTO 11 /* プロトコルエラー数 */
|
---|
421 | #define NC_IP6_IN_ERR_ADDR 12 /* アドレスエラー数 */
|
---|
422 | #define NC_IP6_IN_ERR_VER 13 /* バージョンエラー数 */
|
---|
423 | #define NC_IP6_IN_ERR_SHORT 14 /* 長さエラー数 */
|
---|
424 | #define NC_IP6_IN_ERR_PACKETS 15 /* 受信エラーデータグラム数 */
|
---|
425 | #define NC_IP6_IN_PACKETS 16 /* 受信データグラム数 */
|
---|
426 | #define NC_IP6_IN_OCTETS 17 /* 受信オクテット数 */
|
---|
427 | #define NC_IP6_SIZE 18 /* カウンタ数 */
|
---|
428 |
|
---|
429 | #define NET_COUNT_IP6(v,c) ((v)+=(c))
|
---|
430 |
|
---|
431 | #ifndef _MACRO_ONLY
|
---|
432 |
|
---|
433 | extern T_NET_COUNT_VAL net_count_ip6[NC_IP6_SIZE];
|
---|
434 |
|
---|
435 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
436 |
|
---|
437 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_IP6 */
|
---|
438 |
|
---|
439 | #define NET_COUNT_IP6(v,c)
|
---|
440 |
|
---|
441 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_IP6 */
|
---|
442 |
|
---|
443 | #if NET_COUNT_ENABLE & PROTO_FLG_ICMP6
|
---|
444 |
|
---|
445 | #define NC_ICMP6_OUT_ERR_PACKETS 0 /* 送信エラー ICMP データ数 */
|
---|
446 | #define NC_ICMP6_OUT_PACKETS 1 /* 送信 ICMP データ数 */
|
---|
447 | #define NC_ICMP6_OUT_OCTETS 2 /* 送信 ICMP オクテット数 */
|
---|
448 | #define NC_ICMP6_IN_ERR_CKSUM 3 /* 長さエラー数 */
|
---|
449 | #define NC_ICMP6_IN_ERR_PACKETS 4 /* 受信エラー ICMP データ数 */
|
---|
450 | #define NC_ICMP6_IN_PACKETS 5 /* 受信 ICMP データ数 */
|
---|
451 | #define NC_ICMP6_IN_OCTETS 6 /* 受信 ICMP オクテット数 */
|
---|
452 | #define NC_ICMP6_SIZE 7 /* カウンタ数 */
|
---|
453 |
|
---|
454 | #define NET_COUNT_ICMP6(v,c) ((v)+=(c))
|
---|
455 |
|
---|
456 | #ifndef _MACRO_ONLY
|
---|
457 |
|
---|
458 | extern T_NET_COUNT_VAL net_count_icmp6[NC_ICMP6_SIZE];
|
---|
459 |
|
---|
460 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
461 |
|
---|
462 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_ICMP6 */
|
---|
463 |
|
---|
464 | #define NET_COUNT_ICMP6(v,c)
|
---|
465 |
|
---|
466 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_ICMP6 */
|
---|
467 |
|
---|
468 | #if NET_COUNT_ENABLE & PROTO_FLG_ND6
|
---|
469 |
|
---|
470 | #define NC_ND6_DAD_OUT_PACKETS 0 /* 重複アドレス検出送信数 */
|
---|
471 | #define NC_ND6_NS_OUT_PACKETS 1 /* 近隣要請送信数 */
|
---|
472 | #define NC_ND6_NS_IN_PACKETS 2 /* 近隣要請受信数 */
|
---|
473 | #define NC_ND6_NA_OUT_PACKETS 3 /* 近隣通知送信数 */
|
---|
474 | #define NC_ND6_NA_IN_PACKETS 4 /* 近隣通知受信数 */
|
---|
475 | #define NC_ND6_RS_OUT_PACKETS 5 /* ルータ要請出力数 */
|
---|
476 | #define NC_ND6_RA_IN_PACKETS 6 /* ルータ通知受信数 */
|
---|
477 | #define NC_ND6_SIZE 7 /* カウンタ数 */
|
---|
478 |
|
---|
479 | #define NET_COUNT_ND6(v,c) ((v)+=(c))
|
---|
480 |
|
---|
481 | #ifndef _MACRO_ONLY
|
---|
482 |
|
---|
483 | extern T_NET_COUNT_VAL net_count_nd6[NC_ND6_SIZE];
|
---|
484 |
|
---|
485 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
486 |
|
---|
487 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_ND6 */
|
---|
488 |
|
---|
489 | #define NET_COUNT_ND6(v,c)
|
---|
490 |
|
---|
491 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_ND6 */
|
---|
492 |
|
---|
493 | #endif /* of #if defined(_IP6_CFG) */
|
---|
494 |
|
---|
495 | #ifdef SUPPORT_TCP
|
---|
496 |
|
---|
497 | /* TCP */
|
---|
498 |
|
---|
499 | #if NET_COUNT_ENABLE & PROTO_FLG_TCP
|
---|
500 |
|
---|
501 | #define NC_TCP_CONNECTS 0 /* 能動オープン数 */
|
---|
502 | #define NC_TCP_ACCEPTS 1 /* 受動オープン数 */
|
---|
503 | #define NC_TCP_RTT_UPDATES 2 /* RTT 更新数 */
|
---|
504 | #define NC_TCP_SEND_RSTS 3 /* 送信、RST 数 */
|
---|
505 | #define NC_TCP_SEND_ACKS 4 /* 送信、ACK 数 */
|
---|
506 | #define NC_TCP_SEND_URG_SEGS 5 /* 送信、緊急セグメント数 */
|
---|
507 | #define NC_TCP_SEND_DATA_SEGS 6 /* 送信データセグメント数 */
|
---|
508 | #define NC_TCP_SEND_REXMIT_SEGS 7 /* 再送信セグメント数 */
|
---|
509 | #define NC_TCP_SEND_SEGS 8 /* 送信セグメント数 */
|
---|
510 | #define NC_TCP_SEND_CNTL_SEGS 9 /* 送信制御セグメント数 */
|
---|
511 | #define NC_TCP_SEND_DATA_OCTETS 10 /* 送信データオクテット数 */
|
---|
512 | #define NC_TCP_FREE_RCV_QUEUE 11 /* 受信キュー解放数 */
|
---|
513 | #define NC_TCP_RECV_DUP_SEGS 12 /* 受信、多重数 */
|
---|
514 | #define NC_TCP_RECV_DROP_SEGS 13 /* 受信、破棄数 */
|
---|
515 | #define NC_TCP_RECV_RSTS 14 /* 受信、RST 数 */
|
---|
516 | #define NC_TCP_RECV_DUP_ACKS 15 /* 受信、多重 ACK 数 */
|
---|
517 | #define NC_TCP_RECV_ACKS 16 /* 受信、ACK 数 */
|
---|
518 | #define NC_TCP_RECV_BAD_CKSUMS 17 /* 受信、チェックサム不正数 */
|
---|
519 | #define NC_TCP_RECV_BAD_HEADERS 18 /* 受信、ヘッダ不正数 */
|
---|
520 | #define NC_TCP_RECV_URG_SEGS 19 /* 受信、緊急セグメント数 */
|
---|
521 | #define NC_TCP_RECV_DATA_SEGS 20 /* 受信データセグメント数 */
|
---|
522 | #define NC_TCP_RECV_SEGS 21 /* 受信セグメント数 */
|
---|
523 | #define NC_TCP_RECV_DATA_OCTETS 22 /* 受信データオクテット数 */
|
---|
524 | #define NC_TCP_RECV_OCTETS 23 /* 受信オクテット数 */
|
---|
525 | #define NC_TCP_SIZE 24 /* カウンタ数 */
|
---|
526 |
|
---|
527 | #define NET_COUNT_TCP(v,c) ((v)+=(c))
|
---|
528 |
|
---|
529 | #ifndef _MACRO_ONLY
|
---|
530 |
|
---|
531 | extern T_NET_COUNT_VAL net_count_tcp[NC_TCP_SIZE];
|
---|
532 |
|
---|
533 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
534 |
|
---|
535 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_TCP */
|
---|
536 |
|
---|
537 | #define NET_COUNT_TCP(v,c)
|
---|
538 |
|
---|
539 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_TCP */
|
---|
540 |
|
---|
541 | #endif /* of #ifdef SUPPORT_TCP */
|
---|
542 |
|
---|
543 | #ifdef SUPPORT_UDP
|
---|
544 |
|
---|
545 | /* UDP */
|
---|
546 |
|
---|
547 | #if NET_COUNT_ENABLE & PROTO_FLG_UDP
|
---|
548 |
|
---|
549 | #define NET_COUNT_UDP(v,c) ((v)+=(c))
|
---|
550 |
|
---|
551 | #ifndef _MACRO_ONLY
|
---|
552 |
|
---|
553 | extern T_NET_COUNT net_count_udp;
|
---|
554 |
|
---|
555 | #endif /* of #ifndef _MACRO_ONLY */
|
---|
556 |
|
---|
557 | #else /* of #if NET_COUNT_ENABLE & PROTO_FLG_UDP */
|
---|
558 |
|
---|
559 | #define NET_COUNT_UDP(v,c)
|
---|
560 |
|
---|
561 | #endif /* of #if NET_COUNT_ENABLE & PROTO_FLG_UDP */
|
---|
562 |
|
---|
563 | #endif /* of #ifdef SUPPORT_UDP */
|
---|
564 |
|
---|
565 | #ifdef SUPPORT_MIB
|
---|
566 |
|
---|
567 | /*
|
---|
568 | * SNMP の 管理情報ベース (MIB)
|
---|
569 | */
|
---|
570 |
|
---|
571 | #define NET_COUNT_MIB(v, c) ((v)+=(c))
|
---|
572 |
|
---|
573 | #else /* of #ifdef SUPPORT_MIB */
|
---|
574 |
|
---|
575 | #define NET_COUNT_MIB(v, c)
|
---|
576 |
|
---|
577 | #endif /* of #ifdef SUPPORT_MIB */
|
---|
578 |
|
---|
579 | #endif /* of #ifndef _NET_COUNT_H_ */
|
---|