]>
git.proxmox.com Git - mirror_frr.git/blob - pceplib/pcep_msg_tools.h
2 * This file is part of the PCEPlib, a PCEP protocol library.
4 * Copyright (C) 2020 Volta Networks https://voltanet.io/
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * Author : Brady Johnson <brady@voltanet.io>
26 #include <netinet/in.h> // struct in_addr
28 #include "pcep_utils_double_linked_list.h"
29 #include "pcep_msg_messages.h"
30 #include "pcep_msg_objects.h"
36 #define PCEP_MAX_SIZE 6000
38 /* Returns a double linked list of PCEP messages */
39 double_linked_list
*pcep_msg_read(int sock_fd
);
40 /* Given a double linked list of PCEP messages, return the first node that has
41 * the same message type */
42 struct pcep_message
*pcep_msg_get(double_linked_list
*msg_list
, uint8_t type
);
43 /* Given a double linked list of PCEP messages, return the next node after
44 * current node that has the same message type */
45 struct pcep_message
*pcep_msg_get_next(double_linked_list
*msg_list
,
46 struct pcep_message
*current
,
48 struct pcep_object_header
*pcep_obj_get(double_linked_list
*list
,
49 uint8_t object_class
);
50 struct pcep_object_header
*pcep_obj_get_next(double_linked_list
*list
,
51 struct pcep_object_header
*current
,
52 uint8_t object_class
);
53 struct pcep_object_tlv_header
*pcep_tlv_get(double_linked_list
*list
,
55 struct pcep_object_tlv_header
*
56 pcep_tlv_get_next(double_linked_list
*list
,
57 struct pcep_object_tlv_header
*current
, uint16_t type
);
58 void pcep_obj_free_tlv(struct pcep_object_tlv_header
*tlv
);
59 void pcep_obj_free_object(struct pcep_object_header
*obj
);
60 void pcep_msg_free_message(struct pcep_message
*message
);
61 void pcep_msg_free_message_list(double_linked_list
*list
);
62 void pcep_msg_print(double_linked_list
*list
);
63 const char *get_message_type_str(uint8_t type
);
64 const char *get_object_class_str(uint8_t class);
65 int pcep_msg_send(int sock_fd
, struct pcep_message
*hdr
);