diff options
| author | 刘学利 <[email protected]> | 2020-09-15 09:29:26 +0800 |
|---|---|---|
| committer | 刘学利 <[email protected]> | 2020-09-15 09:29:26 +0800 |
| commit | c72015182fcb115732f716b739113d690e6c68ed (patch) | |
| tree | 6974e09650c1ee6e36aab2fc864c9ea3da367a6d | |
| parent | d8317e984b8858e298bfc6ad7543406f115e7c1e (diff) | |
| parent | 408a5f52ffbb689dca72965544eccd1f94d55407 (diff) | |
Merge branch 'develop' into 'master'v2.0.7
Develop
See merge request MESA_Platform/dns!5
| -rw-r--r-- | cmake/preInstall.sh | 1 | ||||
| -rw-r--r-- | cmake/preUninstall.sh | 7 | ||||
| -rw-r--r-- | include/dns.h | 23 | ||||
| -rw-r--r-- | src/dns.cpp | 22 |
4 files changed, 21 insertions, 32 deletions
diff --git a/cmake/preInstall.sh b/cmake/preInstall.sh index 3519753..53609fe 100644 --- a/cmake/preInstall.sh +++ b/cmake/preInstall.sh @@ -4,6 +4,7 @@ mkdir -p ${DST}/plug/protocol/ mkdir -p ${DST}/etc/ touch ${DST}/plug/conflist.inf touch ${DST}/etc/entrylist.conf + if [[ -z `grep -rn 'dns.inf' ${DST}/plug/conflist.inf` ]];then sed -i '/\[protocol\]/a\./plug/protocol/dns/dns.inf' ${DST}/plug/conflist.inf fi diff --git a/cmake/preUninstall.sh b/cmake/preUninstall.sh index 94ddb0d..5271e06 100644 --- a/cmake/preUninstall.sh +++ b/cmake/preUninstall.sh @@ -1,9 +1,12 @@ #!/bin/sh if [ $1 == 0 ]; then DST=${RPM_INSTALL_PREFIX} - - mkdir -p ${DST}/plug/business/ + + mkdir -p ${DST}/plug/protocol/ touch ${DST}/plug/conflist.inf + + mkdir -p ${DST}/etc/ + touch ${DST}/etc/entrylist.conf sed -i '/dns.inf/d' ${DST}/plug/conflist.inf sed -i '/DNS/d' ${DST}etc/entrylist.conf diff --git a/include/dns.h b/include/dns.h index ed7512e..ed46f81 100644 --- a/include/dns.h +++ b/include/dns.h @@ -303,17 +303,18 @@ enum flag_id { /* ������ֶ�ʱ�������Զ�����ͷ����Ϣ */ DNS_UNKOWN =0, - DNS_ALL = 1<<0, /* ȫ�� */ - DNS_REQ_ALL = 1<<1, /* �����ȫ�� */ - DNS_RES_ALL = 1<<2, /* ���Ӧ���ȫ������ */ - DNS_REQ_HDR = 1<<3, /* �������ͷ������ */ - DNS_RES_HDR = 1<<4, /* ��Ӧ���ͷ������ */ - //DNS_REQ_QUERY = 1<<5, /* ��Ӧ����е�������Ϣ(������������ѯ��Ϣ���Զ�����ͷ������ΪDNS_REQ_ALL_FLAG_ID������û��Ҫ����һ��ֵ) */ - DNS_RES_QUERY = 1<<6, /* ��Ӧ����е�������Ϣ */ - DNS_RES_RRS = 1<<7, /* ������Ӧ����Դ��¼ */ - DNS_RES_ANSWER = 1<<8, /* ��answerӦ���¼ */ - DNS_RES_AUTH = 1<<9, /* ����Ȩ��Դ��¼ */ - DNS_RES_ADD = 1<<10, /* �⸽����Դ��¼ */ + ALL = 1<<0, /* ȫ�� */ + DNS_ALL = 1<<1, /* ȫ�� */ + DNS_REQ_ALL = 1<<2, /* �����ȫ�� */ + DNS_RES_ALL = 1<<3, /* ���Ӧ���ȫ������ */ + DNS_REQ_HDR = 1<<4, /* �������ͷ������ */ + DNS_RES_HDR = 1<<5, /* ��Ӧ���ͷ������ */ + //DNS_REQ_QUERY = 1<<6, /* ��Ӧ����е�������Ϣ(������������ѯ��Ϣ���Զ�����ͷ������ΪDNS_REQ_ALL_FLAG_ID������û��Ҫ����һ��ֵ) */ + DNS_RES_QUERY = 1<<7, /* ��Ӧ����е�������Ϣ */ + DNS_RES_RRS = 1<<8, /* ������Ӧ����Դ��¼ */ + DNS_RES_ANSWER = 1<<9, /* ��answerӦ���¼ */ + DNS_RES_AUTH = 1<<10, /* ����Ȩ��Դ��¼ */ + DNS_RES_ADD = 1<<11, /* �⸽����Դ��¼ */ }; diff --git a/src/dns.cpp b/src/dns.cpp index 5cb4f38..f38b53c 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -68,6 +68,7 @@ g_dns_proto_info_t g_dns_proto_info; static dns_str_contrast_id_t DNS_FLAG_ID[] = { + {"ALL", DNS_ALL}, {"DNS_ALL", DNS_ALL}, {"DNS_REQ_ALL", DNS_REQ_ALL}, {"DNS_RES_ALL", DNS_RES_ALL}, @@ -1263,23 +1264,6 @@ int callback_dns_business_plug(struct streaminfo *a_stream, void **pme, void *in { app_state=APP_STATE_DROPPKT; } - - if(state&PROT_STATE_DROPME) - { - if(app_state&APP_STATE_DROPPKT) - { - app_state|=APP_STATE_DROPME; - } - else - { - app_state=APP_STATE_DROPME; - } - } - - if(state&PROT_STATE_GIVEME) - { - app_state=APP_STATE_GIVEME; - } return app_state; } @@ -1740,7 +1724,7 @@ int parse_dns_protocol(struct streaminfo *a_stream, unsigned char opstate, char } ret=callback_dns_business_plug(a_stream, pme, (void *)&dns_info, DNS_ALL, session_state, thread_seq, a_packet); - if(ret&APP_STATE_DROPME || ret&APP_STATE_DROPPKT) + if(ret&APP_STATE_DROPPKT) { return ret; } @@ -2030,7 +2014,7 @@ int DNS_INIT() *****************************************************************************/ void DNS_DESTROY() { - printf("Hello! This is dns.so PROT_DESTORY, but i am not complete!!!\n"); + return ; } |
