1 /*
2  * Copyright (c) 2018-2021, OARC, Inc.
3  * All rights reserved.
4  *
5  * This file is part of dnsjit.
6  *
7  * dnsjit is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * dnsjit is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with dnsjit.  If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include "config.h"
22 
23 #include "core/object/ether.h"
24 #include "core/assert.h"
25 
26 #include <stdlib.h>
27 #include <string.h>
28 
core_object_ether_copy(const core_object_ether_t * self)29 core_object_ether_t* core_object_ether_copy(const core_object_ether_t* self)
30 {
31     core_object_ether_t* copy;
32     glassert_self();
33 
34     glfatal_oom(copy = malloc(sizeof(core_object_ether_t)));
35     memcpy(copy, self, sizeof(core_object_ether_t));
36     copy->obj_prev = 0;
37 
38     return copy;
39 }
40 
core_object_ether_free(core_object_ether_t * self)41 void core_object_ether_free(core_object_ether_t* self)
42 {
43     glassert_self();
44     free(self);
45 }
46