Browse code

pcre: developer notes

Kevin Lin authored on 2014/10/28 23:33:20
Showing 2 changed files
... ...
@@ -425,6 +425,7 @@ int cli_pcre_build(struct cli_matcher *root, long long unsigned match_limit, lon
425 425
     return CL_SUCCESS;
426 426
 }
427 427
 
428
+/* TODO - handle VI and Macro offset types */
428 429
 int cli_pcre_recaloff(struct cli_matcher *root, struct cli_pcre_off *data, struct cli_target_info *info, cli_ctx *ctx)
429 430
 {
430 431
     /* TANGENT: maintain relative offset data in cli_ac_data? */
... ...
@@ -540,7 +541,8 @@ int cli_pcre_qoff(struct cli_pcre_meta *pm, uint32_t length, uint32_t *adjbuffer
540 540
         *adjshift = pm->offdata[2];
541 541
     }
542 542
     else {
543
-        /* all relative offsets; TODO - check if relative offsets apply for normal hex substrs */
543
+        /* all relative offsets */
544
+        /* TODO - check if relative offsets apply for normal hex substrs */
544 545
         *adjbuffer = 0;
545 546
         *adjshift = 0;
546 547
     }
... ...
@@ -633,6 +635,7 @@ int cli_pcre_scanbuf(const unsigned char *buffer, uint32_t length, const struct
633 633
             }
634 634
             else {
635 635
                 /* NOTE - if using non-encompass method 2, alter shift universally */
636
+                /* TODO - limitations on non-encompassed buffers? */
636 637
                 adjlength = length - adjbuffer;
637 638
             }
638 639
         }
... ...
@@ -90,6 +90,7 @@ static inline int PERF_LOG_TRIES(int8_t acmode, int8_t bm_called, int32_t length
90 90
 }
91 91
 #endif
92 92
 
93
+/* TODO - add mode (map/buffer) trigger for pcre? */
93 94
 static inline int matcher_run(const struct cli_matcher *root,
94 95
 			      const unsigned char *buffer, uint32_t length,
95 96
 			      const char **virname, struct cli_ac_data *mdata,