+/**
+ * Applies the 'equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_eq_uint16(gpointer v1, char* v2) {
+ guint16* r = (guint16*) v1;
+ guint16 l = atoi(v2);
+ return (*r == l);
+}
+
+/**
+ * Applies the 'equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_eq_double(gpointer v1, char* v2) {
+ double* r = (double*) v1;
+ double l = atof(v2);
+ return (*r == l);
+}
+
+/**
+ * Applies the 'equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_eq_string(gpointer v1, char* v2) {
+ char* r = (char*) v1;
+ return (!g_strcasecmp(r,v2));
+}
+
+/**
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_uint64(gpointer v1, char* v2) {
+ guint64* r = (guint64*) v1;
+ guint64 l = atoi(v2);
+ return (*r != l);
+}
+
+/**
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_uint32(gpointer v1, char* v2) {
+ guint32* r = (guint32*) v1;
+ guint32 l = atoi(v2);
+ return (*r != l);
+}
+
+/**
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_uint16(gpointer v1, char* v2) {
+ guint16* r = (guint16*) v1;
+ guint16 l = atoi(v2);
+ return (*r != l);
+}
+
+/**
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_double(gpointer v1, char* v2) {
+ double* r = (double*) v1;
+ double l = atof(v2);
+ return (*r != l);
+}
+
+/**
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_string(gpointer v1, char* v2) {
+ char* r = (char*) v1;
+ return (g_strcasecmp(r,v2));
+}
+
+/**
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_lt_uint64(gpointer v1, char* v2) {
+ guint64* r = (guint64*) v1;
+ guint64 l = atoi(v2);
+ return (*r < l);
+}
+
+/**
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_lt_uint32(gpointer v1, char* v2) {
+ guint32* r = (guint32*) v1;
+ guint32 l = atoi(v2);
+ return (*r < l);
+}
+
+/**
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_lt_uint16(gpointer v1, char* v2) {
+ guint16* r = (guint16*) v1;
+ guint16 l = atoi(v2);
+ return (*r < l);
+}
+
+/**
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_lt_double(gpointer v1, char* v2) {
+ double* r = (double*) v1;
+ double l = atof(v2);
+ return (*r < l);
+}
+
+/**
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_le_uint64(gpointer v1, char* v2) {
+ guint64* r = (guint64*) v1;
+ guint64 l = atoi(v2);
+ return (*r <= l);
+}
+
+/**
+ * Applies the 'lower or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_le_uint32(gpointer v1, char* v2) {
+ guint32* r = (guint32*) v1;
+ guint32 l = atoi(v2);
+ return (*r <= l);
+}
+
+/**
+ * Applies the 'lower or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_le_uint16(gpointer v1, char* v2) {
+ guint16* r = (guint16*) v1;
+ guint16 l = atoi(v2);
+ return (*r <= l);
+}
+
+/**
+ * Applies the 'lower or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_le_double(gpointer v1, char* v2) {
+ double* r = (double*) v1;
+ double l = atof(v2);
+ return (*r <= l);
+}
+
+/**
+ * Applies the 'greater than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_gt_uint64(gpointer v1, char* v2) {
+ guint64* r = (guint64*) v1;
+ guint64 l = atoi(v2);
+ return (*r > l);
+}
+
+/**
+ * Applies the 'greater than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_gt_uint32(gpointer v1, char* v2) {
+ guint32* r = (guint32*) v1;
+ guint32 l = atoi(v2);
+ return (*r > l);
+}
+
+/**
+ * Applies the 'greater than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_gt_uint16(gpointer v1, char* v2) {
+ guint16* r = (guint16*) v1;
+ guint16 l = atoi(v2);
+ return (*r > l);
+}
+
+/**
+ * Applies the 'greater than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_gt_double(gpointer v1, char* v2) {
+ double* r = (double*) v1;
+ double l = atof(v2);
+ return (*r > l);
+}
+
+/**
+ * Applies the 'greater or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ge_uint64(gpointer v1, char* v2) {
+ guint64* r = (guint64*) v1;
+ guint64 l = atoi(v2);
+ return (*r >= l);
+}
+
+/**
+ * Applies the 'greater or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ge_uint32(gpointer v1, char* v2) {
+ guint32* r = (guint32*) v1;
+ guint32 l = atoi(v2);
+ return (*r >= l);
+}
+
+/**
+ * Applies the 'greater or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ge_uint16(gpointer v1, char* v2) {
+ guint16* r = (guint16*) v1;
+ guint16 l = atoi(v2);
+ return (*r >= l);
+}
+
+/**
+ * Applies the 'greater or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ge_double(gpointer v1, char* v2) {
+ double* r = (double*) v1;
+ double l = atof(v2);
+ return (*r >= l);
+}
+
+
+/**
+ * Makes a copy of the current filter tree
+ * @param tree pointer to the current tree
+ * @return new copy of the filter tree
+ */
+LttvFilterTree*
+lttv_filter_tree_clone(LttvFilterTree* tree) {
+
+ LttvFilterTree* newtree = lttv_filter_tree_new();
+
+ newtree->node = tree->node;
+
+ newtree->left = tree->left;
+ if(newtree->left == LTTV_TREE_NODE) {
+ newtree->l_child.t = lttv_filter_tree_clone(tree->l_child.t);
+ } else if(newtree->left == LTTV_TREE_LEAF) {
+ newtree->l_child.leaf = lttv_simple_expression_new();
+ newtree->l_child.leaf->field = tree->l_child.leaf->field;
+ newtree->l_child.leaf->offset = tree->l_child.leaf->offset;
+ newtree->l_child.leaf->op = tree->l_child.leaf->op;
+ newtree->l_child.leaf->value = g_strconcat(tree->l_child.leaf->value);
+ }
+
+ newtree->right = tree->right;
+ if(newtree->right == LTTV_TREE_NODE) {
+ newtree->r_child.t = lttv_filter_tree_clone(tree->r_child.t);
+ } else if(newtree->right == LTTV_TREE_LEAF) {
+ newtree->r_child.leaf = lttv_simple_expression_new();
+ newtree->r_child.leaf->field = tree->r_child.leaf->field;
+ newtree->r_child.leaf->offset = tree->r_child.leaf->offset;
+ newtree->r_child.leaf->op = tree->r_child.leaf->op;
+ newtree->r_child.leaf->value = g_strconcat(tree->r_child.leaf->value);
+ }
+
+ return newtree;
+
+}
+
+/**
+ * Makes a copy of the current filter
+ * @param filter pointer to the current filter
+ * @return new copy of the filter
+ */
+LttvFilter*
+lttv_filter_clone(LttvFilter* filter) {
+
+
+ LttvFilter* newfilter = g_new(LttvFilter,1);
+
+ // newfilter->expression = g_new(char,1)
+ strcpy(newfilter->expression,filter->expression);
+
+ newfilter->head = lttv_filter_tree_clone(filter->head);
+
+ return newfilter;
+
+}
+
+