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