You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/12/08 22:55:32 UTC

[3/4] incubator-mynewt-core git commit: oic; oc_buffer.h contains private API, move it under src.

oic; oc_buffer.h contains private API, move it under src.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/535dbafa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/535dbafa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/535dbafa

Branch: refs/heads/develop
Commit: 535dbafaeed43a26412e4e591bc8167e0469352b
Parents: 7384127
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Dec 8 13:08:55 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Dec 8 14:55:15 2016 -0800

----------------------------------------------------------------------
 net/oic/include/oic/oc_buffer.h           | 41 --------------------------
 net/oic/src/api/oc_buffer.h               | 37 +++++++++++++++++++++++
 net/oic/src/api/oc_client_api.c           |  1 +
 net/oic/src/api/oc_ri.c                   |  2 +-
 net/oic/src/messaging/coap/coap.c         |  1 +
 net/oic/src/messaging/coap/coap.h         |  2 +-
 net/oic/src/messaging/coap/engine.c       |  2 +-
 net/oic/src/messaging/coap/separate.c     |  2 +-
 net/oic/src/messaging/coap/transactions.c |  2 +-
 net/oic/src/port/mynewt/adaptor.c         |  1 -
 net/oic/src/port/mynewt/ble_adaptor.c     |  2 +-
 net/oic/src/port/mynewt/ip_adaptor.c      |  2 +-
 net/oic/src/port/mynewt/serial_adaptor.c  |  2 +-
 net/oic/src/port/oc_connectivity.h        |  5 ++++
 14 files changed, 52 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/include/oic/oc_buffer.h
----------------------------------------------------------------------
diff --git a/net/oic/include/oic/oc_buffer.h b/net/oic/include/oic/oc_buffer.h
deleted file mode 100644
index ff581da..0000000
--- a/net/oic/include/oic/oc_buffer.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-// Copyright (c) 2016 Intel Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-*/
-
-#ifndef OC_BUFFER_H
-#define OC_BUFFER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define OC_MBUF_ENDPOINT(m)                                             \
-    (struct oc_endpoint *)((uint8_t *)m + sizeof(struct os_mbuf) +     \
-                                          sizeof(struct os_mbuf_pkthdr))
-
-struct oc_message;
-struct os_mbuf;
-struct oc_message *oc_allocate_message(void);
-void oc_message_add_ref(struct oc_message *message);
-void oc_message_unref(struct oc_message *message);
-
-void oc_recv_message(struct os_mbuf *m);
-void oc_send_message(struct os_mbuf *m);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* OC_BUFFER_H */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/api/oc_buffer.h
----------------------------------------------------------------------
diff --git a/net/oic/src/api/oc_buffer.h b/net/oic/src/api/oc_buffer.h
new file mode 100644
index 0000000..9631ceb
--- /dev/null
+++ b/net/oic/src/api/oc_buffer.h
@@ -0,0 +1,37 @@
+/*
+// Copyright (c) 2016 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
+
+#ifndef OC_BUFFER_H
+#define OC_BUFFER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct oc_message;
+struct os_mbuf;
+struct oc_message *oc_allocate_message(void);
+void oc_message_add_ref(struct oc_message *message);
+void oc_message_unref(struct oc_message *message);
+
+void oc_recv_message(struct os_mbuf *m);
+void oc_send_message(struct os_mbuf *m);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OC_BUFFER_H */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/api/oc_client_api.c
----------------------------------------------------------------------
diff --git a/net/oic/src/api/oc_client_api.c b/net/oic/src/api/oc_client_api.c
index 0dce249..be6e160 100644
--- a/net/oic/src/api/oc_client_api.c
+++ b/net/oic/src/api/oc_client_api.c
@@ -17,6 +17,7 @@
 #include "messaging/coap/coap.h"
 #include "messaging/coap/transactions.h"
 #include "oc_api.h"
+#include "api/oc_buffer.h"
 
 #ifdef OC_CLIENT
 #define OC_CLIENT_CB_TIMEOUT_SECS COAP_RESPONSE_TIMEOUT

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/api/oc_ri.c
----------------------------------------------------------------------
diff --git a/net/oic/src/api/oc_ri.c b/net/oic/src/api/oc_ri.c
index fae737c..12b1849 100644
--- a/net/oic/src/api/oc_ri.c
+++ b/net/oic/src/api/oc_ri.c
@@ -30,7 +30,7 @@
 #include "port/oc_clock.h"
 #include "port/mynewt/adaptor.h"
 
-#include "oc_buffer.h"
+#include "api/oc_buffer.h"
 #include "oc_core_res.h"
 #include "oc_discovery.h"
 #include "oc_ri.h"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/messaging/coap/coap.c
----------------------------------------------------------------------
diff --git a/net/oic/src/messaging/coap/coap.c b/net/oic/src/messaging/coap/coap.c
index 768a65e..dc3a44e 100644
--- a/net/oic/src/messaging/coap/coap.c
+++ b/net/oic/src/messaging/coap/coap.c
@@ -37,6 +37,7 @@
 #include "coap.h"
 #include "transactions.h"
 
+#include "api/oc_buffer.h"
 #ifdef OC_SECURITY
 #include "security/oc_dtls.h"
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/messaging/coap/coap.h
----------------------------------------------------------------------
diff --git a/net/oic/src/messaging/coap/coap.h b/net/oic/src/messaging/coap/coap.h
index 4ff64d7..c460fff 100644
--- a/net/oic/src/messaging/coap/coap.h
+++ b/net/oic/src/messaging/coap/coap.h
@@ -47,7 +47,6 @@ extern "C" {
 #include <stats/stats.h>
 /* OIC stack headers */
 #include "../src/port/mynewt/config.h"
-#include "oic/oc_buffer.h"
 #include "oic/oc_log.h"
 #include "../src/port/oc_connectivity.h"
 #include "../src/port/oc_random.h"
@@ -227,6 +226,7 @@ uint16_t coap_tcp_msg_size(uint8_t *hdr, int datalen);
 void coap_init_message(coap_packet_t *, coap_message_type_t type,
                        uint8_t code, uint16_t mid);
 size_t coap_serialize_message(coap_packet_t *, uint8_t *buffer, int tcp_hdr);
+typedef struct oc_message oc_message_t;
 void coap_send_message(oc_message_t *message);
 coap_status_t coap_parse_message(coap_packet_t *request, uint8_t *data,
                                  uint16_t data_len, int tcp_hdr);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/messaging/coap/engine.c
----------------------------------------------------------------------
diff --git a/net/oic/src/messaging/coap/engine.c b/net/oic/src/messaging/coap/engine.c
index 756af70..19f9ef9 100644
--- a/net/oic/src/messaging/coap/engine.c
+++ b/net/oic/src/messaging/coap/engine.c
@@ -37,7 +37,7 @@
 #include <string.h>
 
 /* OIC Stack headers */
-#include "oc_buffer.h"
+#include "api/oc_buffer.h"
 #include "oc_ri.h"
 
 #ifdef OC_CLIENT

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/messaging/coap/separate.c
----------------------------------------------------------------------
diff --git a/net/oic/src/messaging/coap/separate.c b/net/oic/src/messaging/coap/separate.c
index 757860e..a6df6dc 100644
--- a/net/oic/src/messaging/coap/separate.c
+++ b/net/oic/src/messaging/coap/separate.c
@@ -40,7 +40,7 @@
 
 #include <os/os_mempool.h>
 
-#include "oc_buffer.h"
+#include "api/oc_buffer.h"
 #include "separate.h"
 #include "transactions.h"
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/messaging/coap/transactions.c
----------------------------------------------------------------------
diff --git a/net/oic/src/messaging/coap/transactions.c b/net/oic/src/messaging/coap/transactions.c
index 95288e6..1159292 100644
--- a/net/oic/src/messaging/coap/transactions.c
+++ b/net/oic/src/messaging/coap/transactions.c
@@ -38,7 +38,7 @@
 
 #include "transactions.h"
 #include "observe.h"
-#include "oc_buffer.h"
+#include "api/oc_buffer.h"
 
 #ifdef OC_CLIENT
 #include "oc_client_state.h"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/port/mynewt/adaptor.c
----------------------------------------------------------------------
diff --git a/net/oic/src/port/mynewt/adaptor.c b/net/oic/src/port/mynewt/adaptor.c
index 83d73dd..79b7f93 100644
--- a/net/oic/src/port/mynewt/adaptor.c
+++ b/net/oic/src/port/mynewt/adaptor.c
@@ -25,7 +25,6 @@
 #include "oic/oc_log.h"
 #include "port/oc_network_events_mutex.h"
 #include "port/oc_connectivity.h"
-#include "oc_buffer.h"
 #include "adaptor.h"
 
 static struct os_eventq *oc_evq;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/port/mynewt/ble_adaptor.c
----------------------------------------------------------------------
diff --git a/net/oic/src/port/mynewt/ble_adaptor.c b/net/oic/src/port/mynewt/ble_adaptor.c
index c59f285..7bfa452 100644
--- a/net/oic/src/port/mynewt/ble_adaptor.c
+++ b/net/oic/src/port/mynewt/ble_adaptor.c
@@ -27,7 +27,7 @@
 #include "oic/oc_gatt.h"
 #include "oic/oc_log.h"
 #include "messaging/coap/coap.h"
-#include "oc_buffer.h"
+#include "api/oc_buffer.h"
 #include "port/oc_connectivity.h"
 #include "adaptor.h"
 #include "host/ble_hs.h"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/port/mynewt/ip_adaptor.c
----------------------------------------------------------------------
diff --git a/net/oic/src/port/mynewt/ip_adaptor.c b/net/oic/src/port/mynewt/ip_adaptor.c
index 1f55156..6f16d96 100644
--- a/net/oic/src/port/mynewt/ip_adaptor.c
+++ b/net/oic/src/port/mynewt/ip_adaptor.c
@@ -30,7 +30,7 @@
 
 #include "port/oc_connectivity.h"
 #include "oic/oc_log.h"
-#include "oc_buffer.h"
+#include "api/oc_buffer.h"
 #include "adaptor.h"
 
 static void oc_event_ip(struct os_event *ev);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/port/mynewt/serial_adaptor.c
----------------------------------------------------------------------
diff --git a/net/oic/src/port/mynewt/serial_adaptor.c b/net/oic/src/port/mynewt/serial_adaptor.c
index 0926abd..224270f 100644
--- a/net/oic/src/port/mynewt/serial_adaptor.c
+++ b/net/oic/src/port/mynewt/serial_adaptor.c
@@ -26,7 +26,7 @@
 
 #include <shell/shell.h>
 
-#include "oc_buffer.h"
+#include "api/oc_buffer.h"
 #include "port/oc_connectivity.h"
 #include "oic/oc_log.h"
 #include "adaptor.h"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/535dbafa/net/oic/src/port/oc_connectivity.h
----------------------------------------------------------------------
diff --git a/net/oic/src/port/oc_connectivity.h b/net/oic/src/port/oc_connectivity.h
index 0735b67..cd9042f 100644
--- a/net/oic/src/port/oc_connectivity.h
+++ b/net/oic/src/port/oc_connectivity.h
@@ -52,6 +52,11 @@ typedef struct oc_endpoint {
     };
 } oc_endpoint_t;
 
+#define OC_MBUF_ENDPOINT(m)                                            \
+    (struct oc_endpoint *)((uint8_t *)m + sizeof(struct os_mbuf) +      \
+                           sizeof(struct os_mbuf_pkthdr))
+
+
 #define oc_make_ip_endpoint(__name__, __flags__, __port__, ...)                \
   oc_endpoint_t __name__ = {.flags = __flags__,                                \
                             .ipv6_addr = {.port = __port__,                    \