[qca-nss-ecm] Add Mark Classifier

With this classifier an external kernel module which
is registered with this classifiers callbacks can inspect
the skb and make smart decisions on that buffer, returns
a mark value extracted from the buffer for future use.

Change-Id: I6b1cce6585d105603bef84f697bc0d47fb6b0105
Signed-off-by: Murat Sezgin <msezgin@codeaurora.org>
diff --git a/ecm_init.c b/ecm_init.c
index 68ee556..c8ef5bd 100644
--- a/ecm_init.c
+++ b/ecm_init.c
@@ -1,6 +1,6 @@
 /*
  **************************************************************************
- * Copyright (c) 2014-2016, The Linux Foundation.  All rights reserved.
+ * Copyright (c) 2014-2016, 2018, The Linux Foundation.  All rights reserved.
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * above copyright notice and this permission notice appear in all copies.
@@ -59,6 +59,11 @@
 extern int ecm_classifier_default_init(struct dentry *dentry);
 extern void ecm_classifier_default_exit(void);
 
+#ifdef ECM_CLASSIFIER_MARK_ENABLE
+extern int ecm_classifier_mark_init(struct dentry *dentry);
+extern void ecm_classifier_mark_exit(void);
+#endif
+
 #ifdef ECM_CLASSIFIER_NL_ENABLE
 extern int ecm_classifier_nl_rules_init(struct dentry *dentry);
 extern void ecm_classifier_nl_rules_exit(void);
@@ -139,6 +144,12 @@
 		goto err_cls_pcc;
 	}
 #endif
+#ifdef ECM_CLASSIFIER_MARK_ENABLE
+	ret = ecm_classifier_mark_init(ecm_dentry);
+	if (0 != ret) {
+		goto err_cls_mark;
+	}
+#endif
 
 	ret = ecm_interface_init();
 	if (0 != ret) {
@@ -196,6 +207,10 @@
 #endif
 	ecm_interface_exit();
 err_iface:
+#ifdef ECM_CLASSIFIER_MARK_ENABLE
+	ecm_classifier_mark_exit();
+err_cls_mark:
+#endif
 #ifdef ECM_CLASSIFIER_PCC_ENABLE
 	ecm_classifier_pcc_exit();
 err_cls_pcc:
@@ -281,6 +296,10 @@
 	DEBUG_INFO("exit nl classifier\n");
 	ecm_classifier_nl_rules_exit();
 #endif
+#ifdef ECM_CLASSIFIER_MARK_ENABLE
+	DEBUG_INFO("exit mark classifier\n");
+	ecm_classifier_mark_exit();
+#endif
 	DEBUG_INFO("exit default classifier\n");
 	ecm_classifier_default_exit();
 	DEBUG_INFO("exit db\n");