diff options
| author | lijia <[email protected]> | 2024-04-27 22:31:48 +0800 |
|---|---|---|
| committer | lijia <[email protected]> | 2024-04-28 19:13:45 +0800 |
| commit | ed1ff3bc45c45a3ed131beadf1584529e28b2856 (patch) | |
| tree | f0762619ceeabb70aadd8508799a9b1ac0ae9e44 /src/dealpkt/plug_support.c | |
| parent | 16a633839f9917d26fe229ddaa887fe10b57deac (diff) | |
update g_current_time based on the timestamp of the pcap packet header
Diffstat (limited to 'src/dealpkt/plug_support.c')
| -rw-r--r-- | src/dealpkt/plug_support.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c index b5a5aab..2b2e765 100644 --- a/src/dealpkt/plug_support.c +++ b/src/dealpkt/plug_support.c @@ -538,7 +538,7 @@ int get_rawpkt_opt_from_streaminfo(const struct streaminfo *pstream, int type, v return ret;
}
- /* sappv4.2֮��, û��mrtunnat, ����ctrlzone��ȡ��Щvxlan��ص��?, Ҫ��streaminfo->pfatherƫ�ƻ�ȡ */
+ /* sappv4.2֮��, û��mrtunnat, ����ctrlzone��ȡ��Щvxlan��ص��?, Ҫ��streaminfo->pfatherƫ�ƻ�ȡ */
switch(type){
case RAW_PKT_GET_GDEV_IP:
case RAW_PKT_GET_VXLAN_ID:
@@ -552,16 +552,13 @@ int get_rawpkt_opt_from_streaminfo(const struct streaminfo *pstream, int type, v return get_vxlan_info_from_streaminfo(pstream_pr, type, out_value);
break;
}
- if(pstream_pr->polling_inject_context == NULL)
- {
- return ret;
- }
+
switch(type)
{
case RAW_PKT_GET_ROUTE_CTX:
{
void **value = (void **)out_value;
- if(pstream_pr->polling_inject_context->meta_stream_dir[pstream->curdir - 1] != NULL)
+ if(pstream_pr->polling_inject_context!= NULL && pstream_pr->polling_inject_context->meta_stream_dir[pstream->curdir - 1] != NULL)
{
*value = (void *)(pstream_pr->polling_inject_context->meta_stream_dir[pstream->curdir - 1]->data);
ret = pstream_pr->polling_inject_context->meta_stream_dir[pstream->curdir - 1]->sz_data;
@@ -572,7 +569,7 @@ int get_rawpkt_opt_from_streaminfo(const struct streaminfo *pstream, int type, v case RAW_PKT_GET_SID_LIST:
{
void **value = (void **)out_value;
- if(pstream_pr->polling_inject_context->meta_stream_dir[pstream->curdir - 1] != NULL)
+ if(pstream_pr->polling_inject_context!= NULL && pstream_pr->polling_inject_context->meta_stream_dir[pstream->curdir - 1] != NULL)
{
*value = (void *)(&pstream_pr->polling_inject_context->meta_stream_dir[pstream->curdir - 1]->raw_sid_list);
ret = sizeof(struct segment_id_list);
@@ -1208,7 +1205,7 @@ static void sapp_mac_addr_to_long(const unsigned char *mac_addr, unsigned long l ptr += 5; /* ָ��long long �ĵ�6���ֽ� */
for(i = 0; i < 6; i++){
- *ptr-- = *mac_addr++; /* �������ݰ���mac������?, copy��long long����������?(��ȥ���?2���ֽں�) */
+ *ptr-- = *mac_addr++; /* �������ݰ���mac������?, copy��long long����������?(��ȥ���?2���ֽں�) */
}
}
@@ -1264,14 +1261,14 @@ static int sapp_get_vxlan_info_from_streaminfo(const struct streaminfo *pstream, for(i = 0; i < 6; i++, ptr += 3){
sprintf((char *)ptr, "%02x:", mim_addr->inner_src_mac[i]);
}
- vxinfo->inner_smac[17] = '\0'; /* ���һλ����? */
+ vxinfo->inner_smac[17] = '\0'; /* ���һλ����? */
memcpy(vxinfo->inner_smac_hex, mim_addr->inner_src_mac, 6);
ptr = vxinfo->inner_dmac;
for(i = 0; i < 6; i++, ptr += 3){
sprintf((char *)ptr, "%02x:", mim_addr->inner_dst_mac[i]);
}
- vxinfo->inner_dmac[17] = '\0'; /* ���һλ����? */
+ vxinfo->inner_dmac[17] = '\0'; /* ���һλ����? */
memcpy(vxinfo->inner_dmac_hex, mim_addr->inner_dst_mac, 6);
}
else
@@ -1280,14 +1277,14 @@ static int sapp_get_vxlan_info_from_streaminfo(const struct streaminfo *pstream, for(i = 0; i < 6; i++, ptr += 3){
sprintf((char *)ptr, "%02x:", mac_addr->src_addr.h_source[i]);
}
- vxinfo->inner_smac[17] = '\0'; /* ���һλ����? */
+ vxinfo->inner_smac[17] = '\0'; /* ���һλ����? */
memcpy(vxinfo->inner_smac_hex, mac_addr->src_addr.h_source, 6);
ptr = vxinfo->inner_dmac;
for(i = 0; i < 6; i++, ptr += 3){
sprintf((char *)ptr, "%02x:", mac_addr->src_addr.h_dest[i]);
}
- vxinfo->inner_dmac[17] = '\0'; /* ���һλ����? */
+ vxinfo->inner_dmac[17] = '\0'; /* ���һλ����? */
memcpy(vxinfo->inner_dmac_hex, mac_addr->src_addr.h_dest, 6);
}
return 0;
@@ -1396,7 +1393,7 @@ static int MESA_get_stream_dup_pkt_stat(const struct streaminfo *pstream, void * return 0;
}
- /* �������ظ�������?,����û�������ظ��� */
+ /* �������ظ�������?,����û�������ظ��� */
if(STREAM_TYPE_TCP == pstream->type){
if(pstream->ptcpdetail->clientpktnum + pstream->ptcpdetail->serverpktnum < dup_pkt_para->first_packets){ /* ��̫��, �������ж���û���ظ��� */
*res_val = -2;
@@ -2105,7 +2102,7 @@ int get_current_thread_cpu_affinity_id(void) int tot_cpu_set_count = CPU_COUNT(¤t_cpu_mask);
if((tot_cpu_set_count == tot_cpu_core) || (tot_cpu_set_count > 1)){
/* ȫ����������, ��ʵ����û�а�,
- �����������isolcpus, ���㲻���?, CPU_COUNT���ܺ������������?,
+ �����������isolcpus, ���㲻���?, CPU_COUNT���ܺ������������?,
��������1���϶���û�о�ȷ��ij������ */
return -1;
}
@@ -2150,7 +2147,7 @@ void *dictator_realloc(int thread_seq, void *ptr, size_t size) return realloc(ptr, size);
}
-/* ��ҵ�������ص�ֵת����ƽ̨������?, ����PROT_STATE_xxxת��ΪAPP_STATE_xxx */
+/* ��ҵ�������ص�ֵת����ƽ̨������?, ����PROT_STATE_xxxת��ΪAPP_STATE_xxx */
char biz_retval_to_platform(char biz_ret)
{
char plat_ret = 0;
|
