messages CHANGE messages.* removed
diff --git a/src/messages.c b/src/messages.c
deleted file mode 100644
index 7e84e02..0000000
--- a/src/messages.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * \file messages.c
- * \author Radek Krejci <rkrejci@cesnet.cz>
- * \brief libnetconf2 - NETCONF messages functions
- *
- * Copyright (c) 2015 CESNET, z.s.p.o.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-#include <libyang/libyang.h>
-
-#include "config.h"
-#include "messages.h"
-#include "messages_p.h"
-
-API void
-nc_notif_free(struct nc_notif *notif)
-{
- if (!notif) {
- return;
- }
-
- lydict_remove(notif->tree->schema->module->ctx, notif->datetime);
- lyd_free(notif->tree);
- free(notif);
-}
diff --git a/src/messages.h b/src/messages.h
deleted file mode 100644
index 027461f..0000000
--- a/src/messages.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * \file messages.h
- * \author Michal Vasko <mvasko@cesnet.cz>
- * \brief libnetconf2's public functions and structures of NETCONF messages.
- *
- * Copyright (c) 2015 CESNET, z.s.p.o.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- */
-
-#ifndef NC_MESSAGES_H_
-#define NC_MESSAGES_H_
-
-typedef enum {
- NC_PARAMTYPE_CONST,
- NC_PARAMTYPE_FREE,
- NC_PARAMTYPE_DUP_AND_FREE
-} NC_PARAMTYPE;
-
-typedef enum {
- NC_RPL_OK,
- NC_RPL_DATA,
- NC_RPL_ERROR,
- NC_RPL_NOTIF
-} NC_RPL;
-
-/**
- * @brief NETCONF notification object
- */
-struct nc_notif;
-
-/**
- * @brief Free the NETCONF Notification object.
- * @param[in] rpc Object to free.
- */
-void nc_notif_free(struct nc_notif *notif);
-
-#endif /* NC_MESSAGES_H_ */
diff --git a/src/messages_client.c b/src/messages_client.c
index dfc7485..3a670c0 100644
--- a/src/messages_client.c
+++ b/src/messages_client.c
@@ -627,3 +627,15 @@
free(reply);
}
+
+API void
+nc_notif_free(struct nc_notif *notif)
+{
+ if (!notif) {
+ return;
+ }
+
+ lydict_remove(notif->tree->schema->module->ctx, notif->datetime);
+ lyd_free(notif->tree);
+ free(notif);
+}
diff --git a/src/messages_p.h b/src/messages_p.h
index a5c690e..36f5562 100644
--- a/src/messages_p.h
+++ b/src/messages_p.h
@@ -25,7 +25,6 @@
#include <libyang/libyang.h>
-#include "messages.h"
#include "messages_server.h"
#include "messages_client.h"
diff --git a/src/messages_server.h b/src/messages_server.h
index 017ea63..3c38363 100644
--- a/src/messages_server.h
+++ b/src/messages_server.h
@@ -27,7 +27,7 @@
#include "netconf.h"
-typedef enum {
+typedef enum NC_ERROR {
NC_ERR_UNKNOWN = 0,
NC_ERR_IN_USE,
NC_ERR_INVALID_VALUE,
@@ -50,7 +50,7 @@
NC_ERR_MALFORMED_MSG
} NC_ERR;
-typedef enum {
+typedef enum NC_ERROR_TYPE {
NC_ERR_TYPE_UNKNOWN = 0,
NC_ERR_TYPE_TRAN,
NC_ERR_TYPE_RPC,
diff --git a/src/netconf.h b/src/netconf.h
index c15d0ec..bb48794 100644
--- a/src/netconf.h
+++ b/src/netconf.h
@@ -91,6 +91,19 @@
NC_WD_EXPLICIT = 0x08
} NC_WD_MODE;
+typedef enum NC_PARAMTYPE {
+ NC_PARAMTYPE_CONST,
+ NC_PARAMTYPE_FREE,
+ NC_PARAMTYPE_DUP_AND_FREE
+} NC_PARAMTYPE;
+
+typedef enum NC_REPLY {
+ NC_RPL_OK,
+ NC_RPL_DATA,
+ NC_RPL_ERROR,
+ NC_RPL_NOTIF
+} NC_RPL;
+
/**
* @brief Transform given time_t (seconds since the epoch) into the RFC 3339 format
* accepted by NETCONF functions.
diff --git a/src/session_client.h b/src/session_client.h
index 27db099..035e5b1 100644
--- a/src/session_client.h
+++ b/src/session_client.h
@@ -39,7 +39,6 @@
#include "session.h"
#include "netconf.h"
-#include "messages.h"
#include "messages_client.h"
/**
diff --git a/src/session_p.h b/src/session_p.h
index d296786..58827c9 100644
--- a/src/session_p.h
+++ b/src/session_p.h
@@ -31,7 +31,6 @@
#include "libnetconf.h"
#include "netconf.h"
#include "session.h"
-#include "messages.h"
#ifdef ENABLE_SSH
diff --git a/src/session_server.h b/src/session_server.h
index 5581664..21b5fbd 100644
--- a/src/session_server.h
+++ b/src/session_server.h
@@ -27,7 +27,6 @@
#include <libyang/libyang.h>
#include "session.h"
-#include "messages.h"
#include "netconf.h"
typedef struct nc_server_reply *(*nc_rpc_clb)(struct lyd_node *rpc, struct nc_session *session);