1 /*
2  * Project: udptunnel
3  * File: destination.c
4  *
5  * Copyright (C) 2009 Andreas Rottmann
6  * Contact: a.rottmann@gmx.at
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef DESTINATION_H
23 #define DESTINATION_H
24 
25 #include <stddef.h>
26 
27 typedef struct destination {
28         const char *host;
29         const char *port;
30         char *data;
31 } destination_t;
32 
33 #define p_destination_copy ((void* (*)(void *, const void *, size_t))&destination_copy)
34 #define p_destination_cmp ((int (*)(const void *, const void *, size_t))&destination_cmp)
35 #define p_destination_free ((void (*)(void *))&destination_free)
36 
37 destination_t *destination_create(const char *address);
38 destination_t *destination_copy(destination_t *dst, destination_t *src, size_t len);
39 int destination_cmp(destination_t *c1, destination_t *c2, size_t len);
40 void destination_free(destination_t *c);
41 
42 #endif
43