diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2021-03-16 14:03:34 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-16 14:03:34 -0400 |
| commit | 3406c16cbeecafb400cc2155a1ca9f9504c95b4e (patch) | |
| tree | 7853ddaa015a1542723f925b863d4440d9ff3529 /pceplib/pcep_utils_queue.h | |
| parent | 30643d6f314c8b5462073b2382c799b7966528e8 (diff) | |
| parent | 749714731ee9a59ae39be77e7db3915ce3ad0bd8 (diff) | |
Merge pull request #7963 from volta-networks/feat_pceplib_into_frr_github
pceplib: Integrate pcelib into frr
Diffstat (limited to 'pceplib/pcep_utils_queue.h')
| -rw-r--r-- | pceplib/pcep_utils_queue.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/pceplib/pcep_utils_queue.h b/pceplib/pcep_utils_queue.h new file mode 100644 index 0000000000..838067640e --- /dev/null +++ b/pceplib/pcep_utils_queue.h @@ -0,0 +1,49 @@ +/* + * This file is part of the PCEPlib, a PCEP protocol library. + * + * Copyright (C) 2020 Volta Networks https://voltanet.io/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + * Author : Brady Johnson <brady@voltanet.io> + * + */ + + +#ifndef INCLUDE_PCEPUTILSQUEUE_H_ +#define INCLUDE_PCEPUTILSQUEUE_H_ + +typedef struct queue_node_ { + struct queue_node_ *next_node; + void *data; + +} queue_node; + +typedef struct queue_handle_ { + queue_node *head; + queue_node *tail; + unsigned int num_entries; + /* Set to 0 to disable */ + unsigned int max_entries; + +} queue_handle; + +queue_handle *queue_initialize(void); +queue_handle *queue_initialize_with_size(unsigned int max_entries); +void queue_destroy(queue_handle *handle); +void queue_destroy_with_data(queue_handle *handle); +queue_node *queue_enqueue(queue_handle *handle, void *data); +void *queue_dequeue(queue_handle *handle); + +#endif /* INCLUDE_PCEPUTILSQUEUE_H_ */ |
