diff options
| author | lijia <[email protected]> | 2019-12-26 14:19:33 +0800 |
|---|---|---|
| committer | lijia <[email protected]> | 2019-12-26 14:19:33 +0800 |
| commit | 98228e4e577f0df244beb0e2702776fa39877670 (patch) | |
| tree | fb17910f54b85ea8d7ba61ebae880db4831d96d4 | |
| parent | 86c5a186658644901d8ba049716f80ef890466a4 (diff) | |
增加串联模式下,inbound,outbound两个方向的统计计数.
| -rw-r--r-- | bin/etc/sapp.toml | 6 | ||||
| -rw-r--r-- | include/private/sapp_pkt_stat.h | 3 | ||||
| -rw-r--r-- | include/public/stream_inc/stream_control.h | 16 | ||||
| -rw-r--r-- | src/inner_plug/sapp_assistant.cpp | 2 | ||||
| -rw-r--r-- | version.txt | 12 |
5 files changed, 28 insertions, 11 deletions
diff --git a/bin/etc/sapp.toml b/bin/etc/sapp.toml index 1a761fd..6254611 100644 --- a/bin/etc/sapp.toml +++ b/bin/etc/sapp.toml @@ -14,6 +14,12 @@ worker_threads=1 bind_mask=[1] [PACKET_IO] +### note, used to represent inbound or outbound direction value, +### because it comes from other device, so it needs to be specified manually, +### if inbound_route_dir=1, then outbound_route_dir=0, vice versa, +### in other words, outbound_route_dir = 1 ^ inbound_route_dir; +inbound_route_dir=1 + ### note, BSD_packet_filter, if you do not want to set any filter rule, keep it empty as "" BSD_packet_filter="" diff --git a/include/private/sapp_pkt_stat.h b/include/private/sapp_pkt_stat.h index f9e3f3c..3932335 100644 --- a/include/private/sapp_pkt_stat.h +++ b/include/private/sapp_pkt_stat.h @@ -22,6 +22,9 @@ typedef enum __sapp_sys_stat_type{ /************* send packet *******************/ SAPP_STAT_ETH_EGRESS, /* ����ģʽ�µĻ�������, �����Ϻ�SAPP_STAT_RCV_ETHERNET���, �����в������DROPPKT */ + + SAPP_STAT_ETH_INBOUND, /* ����ģʽ��, �ǵ�ǰ������I/O����, ��������ڵ�ǰ�豸��������λ��, ���뾳�������� */ + SAPP_STAT_ETH_OUTBOUND, /* ����ģʽ��, �ǵ�ǰ������I/O����, ��������ڵ�ǰ�豸��������λ��, ���뾳�������� */ SAPP_STAT_SND_ETHERNET, /* ����������͵�����, ������������������ */ SAPP_STAT_SND_IPV4, diff --git a/include/public/stream_inc/stream_control.h b/include/public/stream_inc/stream_control.h index d039d74..5f6b4c4 100644 --- a/include/public/stream_inc/stream_control.h +++ b/include/public/stream_inc/stream_control.h @@ -5,7 +5,7 @@ extern "C" {
#endif
-#define STREAM_CONTROL_H_VERSION (20191218)
+#define STREAM_CONTROL_H_VERSION (20191226)
#define TCP_CTEAT_LINK_BYSYN 0x01 /* for MESA_stream_opt->MSO_TCP_CREATE_LINK_MODE */
#define TCP_CTEAT_LINK_BYDATA 0x02 /* for MESA_stream_opt->MSO_TCP_CREATE_LINK_MODE */
@@ -34,6 +34,10 @@ enum MESA_stream_opt{ MSO_GLOBAL_STREAM_ID, /* opt_val type must be unsigned long long, is value-result argument, IN: device_id, value range[0, 4095]; OUT:global stream id */
MSO_DROP_STREAM, /* opt_val type must be int, value only be [0,1]; similar to DROPPKT, but effective scope is stream. */
MSO_TCP_RST_REMEDY, /* opt_val type must be int, value only be [0,1]; if not set this, default is disable. */
+ MSO_TOTAL_INBOUND_PKT, /* opt_val type must be unsigned long long */
+ MSO_TOTAL_INBOUND_BYTE, /* opt_val type must be unsigned long long */
+ MSO_TOTAL_OUTBOUND_PKT, /* opt_val type must be unsigned long long */
+ MSO_TOTAL_OUTBOUND_BYTE,/* opt_val type must be unsigned long long */
__MSO_MAX,
};
@@ -64,11 +68,15 @@ enum sapp_platform_opt{ SPO_FIELD_STAT_HANDLE, /* field stat output handle, opt_val type must be void * */
SPO_INDEPENDENT_THREAD_ID, /* plug independent thread which is created by pthread_create(), opt_val type must be int */
SPO_DEPLOYMENT_MODE_STR, /* opt_val type is char[], optional value is:["mirror", "inline", "transparent"] */
- SPO_TOTAL_EGRESS_PKT, /* total egress packet number, effective in inline or transparent mode, opt_val type must be unsigned long long */
- SPO_TOTAL_EGRESS_BYTE, /* total egress packet byte, effective in inline or transparent mode, opt_val type must be unsigned long long */
+ //SPO_TOTAL_EGRESS_PKT, /* total egress packet number, effective in inline or transparent mode, opt_val type must be unsigned long long */
+ //SPO_TOTAL_EGRESS_BYTE, /* total egress packet byte, effective in inline or transparent mode, opt_val type must be unsigned long long */
SPO_TCP_STREAM_NEW, /* total created tcp streams from start, opt_val type must be unsigned long long */
SPO_TCP_STREAM_CLOSE, /* total closed tcp streams from start, opt_val type must be unsigned long long */
- SPO_TCP_STREAM_LIVE, /* realtime established tcp streams, opt_val type must be unsigned long long */
+ SPO_TCP_STREAM_ESTAB, /* realtime established tcp streams, opt_val type must be unsigned long long */
+ SPO_TOTAL_INBOUND_PKT, /* total inbound packet number, opt_val type must be unsigned long long */
+ SPO_TOTAL_INBOUND_BYTE, /* total inbound packet bytes, opt_val type must be unsigned long long */
+ SPO_TOTAL_OUTBOUND_PKT, /* total outbound packet number, opt_val type must be unsigned long long */
+ SPO_TOTAL_OUTBOUND_BYTE, /* total outbound packet bytes, opt_val type must be unsigned long long */
};
diff --git a/src/inner_plug/sapp_assistant.cpp b/src/inner_plug/sapp_assistant.cpp index 88d4dcb..e91b8fa 100644 --- a/src/inner_plug/sapp_assistant.cpp +++ b/src/inner_plug/sapp_assistant.cpp @@ -194,7 +194,7 @@ int sapp_get_platform_opt(enum sapp_platform_opt opt, void *opt_val, int *opt_va } break; - case SPO_TCP_STREAM_LIVE: + case SPO_TCP_STREAM_ESTAB: { if(*opt_val_len != sizeof(long long)){ ret = -1; diff --git a/version.txt b/version.txt index 02ec16a..a4581d8 100644 --- a/version.txt +++ b/version.txt @@ -3,16 +3,16 @@ VCS_TYPE="git" VCS_BASENAME="v4.0" VCS_UUID="efa070923d8398b49f41acda82b839d11eb75230" -VCS_NUM="144" -VCS_DATE="2019-12-18T11:25:47+0800" -VCS_BRANCH="feature-v4.0-get-traffic" +VCS_NUM="145" +VCS_DATE="2019-12-19T19:41:05+0800" +VCS_BRANCH="sapp_v4" VCS_TAG="v4.0.7" -VCS_TICK="0" +VCS_TICK="1" VCS_EXTRA="" VCS_ACTION_STAMP="" -VCS_FULL_HASH="422766471efa716d82f8d50f6041bb5944cd1d1a" -VCS_SHORT_HASH="4227664" +VCS_FULL_HASH="86c5a186658644901d8ba049716f80ef890466a4" +VCS_SHORT_HASH="86c5a18" VCS_WC_MODIFIED="1" |
