소스 검색

modules/sdpops: use ser_memmem from core

Juha Heinanen 11 년 전
부모
커밋
5c25ba35f3
1개의 변경된 파일1개의 추가작업 그리고 33개의 파일을 삭제
  1. 1 33
      modules/sdpops/sdpops_mod.c

+ 1 - 33
modules/sdpops/sdpops_mod.c

@@ -35,6 +35,7 @@
 #include "../../parser/sdp/sdp_helpr_funcs.h"
 #include "../../parser/sdp/sdp_helpr_funcs.h"
 #include "../../trim.h"
 #include "../../trim.h"
 #include "../../data_lump.h"
 #include "../../data_lump.h"
+#include "../../ut.h"
 
 
 #include "api.h"
 #include "api.h"
 #include "sdpops_data.h"
 #include "sdpops_data.h"
@@ -903,39 +904,6 @@ static int w_sdp_remove_media(sip_msg_t* msg, char* media, char *bar)
 }
 }
 
 
 
 
-/*
- * ser_memmem() returns the location of the first occurrence of data
- * pattern b2 of size len2 in memory block b1 of size len1 or
- * NULL if none is found. Obtained from NetBSD.
- */
-void *
-ser_memmem(const void *b1, const void *b2, size_t len1, size_t len2)
-{
-        /* Initialize search pointer */
-        char *sp = (char *) b1;
-
-        /* Initialize pattern pointer */
-        char *pp = (char *) b2;
-
-        /* Initialize end of search address space pointer */
-        char *eos = sp + len1 - len2;
-
-        /* Sanity check */
-        if(!(b1 && b2 && len1 && len2))
-                return NULL;
-
-        while (sp <= eos) {
-                if (*sp == *pp)
-                        if (memcmp(sp, pp, len2) == 0)
-                                return sp;
-
-                        sp++;
-        }
-
-        return NULL;
-}
-
-
 /** 
 /** 
  * @brief check 'media' matches the value of any 'm=media port value ...' lines
  * @brief check 'media' matches the value of any 'm=media port value ...' lines
  * @return -1 - error; 0 - not found; 1 - found
  * @return -1 - error; 0 - not found; 1 - found