blob: cdf4dd11733753e4a5ff2f1fc9c39d9d527d2949 [file] [log] [blame]
Radek Krejcia53b3fe2015-10-19 17:25:04 +02001/**
2 * \file messages.c
3 * \author Radek Krejci <rkrejci@cesnet.cz>
4 * \brief libnetconf2 - NETCONF messages functions
5 *
6 * Copyright (c) 2015 CESNET, z.s.p.o.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * 3. Neither the name of the Company nor the names of its contributors
18 * may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 */
22
23#include <stdlib.h>
24
25#include <libyang/libyang.h>
26
27#include "libnetconf.h"
28#include "messages_p.h"
29
30API void
31nc_rpc_free(struct nc_rpc *rpc)
32{
33 if (!rpc) {
34 return;
35 }
36
37 lyxml_free_elem(rpc->ctx, rpc->root);
38 lyd_free(rpc->tree);
39 free(rpc);
40}
41
42API void
43nc_reply_free(struct nc_reply *reply)
44{
45 if (!reply) {
46 return;
47 }
48
49 lyxml_free_elem(reply->ctx, reply->root);
50 lyd_free(reply->tree);
51 free(reply);
52}
53API void
54nc_notif_free(struct nc_notif *notif)
55{
56 if (!notif) {
57 return;
58 }
59
60 lyxml_free_elem(notif->ctx, notif->root);
61 lyd_free(notif->tree);
62 free(notif);
63}