1/*
2 * Copyright (C) NEC Europe Ltd., 2003
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the project nor the names of its contributors
14 *    may be used to endorse or promote products derived from this software
15 *    without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#ifndef __RELAY6_PARSER_H_DEFINED
31#define __RELAY6_PARSER_H_DEFINED
32
33#include "dhcp6r.h"
34#include "relay6_socket.h"
35
36struct msg_parser {
37	struct msg_parser *next;
38	struct msg_parser *prev;
39
40	int if_index;
41	uint8_t msg_type;
42	uint8_t hop;
43	uint8_t *buffer;
44	uint8_t *ptomsg;
45	uint8_t *pstart, *pointer_start, *hc_pointer;
46	uint32_t datalength;  /* the length of the DHCPv6 message */
47	int dst_addr_type;
48	char src_addr[INET6_ADDRSTRLEN];  /* source address from the UDP packet */
49	char peer_addr[INET6_ADDRSTRLEN];
50	char link_addr[INET6_ADDRSTRLEN];
51	int interface_in, hop_count;
52	int sent;
53	int isRF;
54};
55
56struct msg_parser msg_parser_list;
57
58struct msg_parser *create_parser_obj __P((void));
59int put_msg_in_store __P((struct msg_parser *mesg));
60int check_buffer __P((int ref, struct msg_parser *mesg));
61
62#endif /* __RELAY6_PARSER_H_DEFINED */
63