1 #include "md_stdlib.h"
\r
2 #include "gsconfig.h"
\r
4 #include "rts_external.h"
\r
6 /* ------------------------------------------------
\r
7 Copyright 2014 AT&T Intellectual Property
\r
8 Licensed under the Apache License, Version 2.0 (the "License");
\r
9 you may not use this file except in compliance with the License.
\r
10 You may obtain a copy of the License at
\r
12 http://www.apache.org/licenses/LICENSE-2.0
\r
14 Unless required by applicable law or agreed to in writing, software
\r
15 distributed under the License is distributed on an "AS IS" BASIS,
\r
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
17 See the License for the specific language governing permissions and
\r
18 limitations under the License.
\r
19 ------------------------------------------- */
\r
22 gs_retval_t has_ipv4_option( struct gs_string * s, gs_uint32_t ipoption) {
\r
27 if (s->length==0) return 0; /* no match */
\r
30 if ((on=s->data[x]&0x1f)==ipoption) return 1; /* got a match */
\r
33 return 0; /* no match and end of list */
\r
35 x++; /* one byte options */
\r
37 case 2: /* 11 byte security option */
\r
41 x+=4; /* stream id option */
\r
47 if (x+1>=s->length) return 0; /* run out of data no match */
\r
52 return 0; /* don't undestand the option */
\r
54 if (x>=s->length) return 0; /* run out of data no match */
\r
57 return 0; /* should never be reached */
\r