You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2016/03/03 01:15:41 UTC
[06/10] incubator-mynewt-site git commit: Added documentation for
mbuf. Added skeleton for mqueue. Closes pull request #21.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/370712c1/os/core_os/mbuf/_os_mbuf_copypkthdr/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/mbuf/_os_mbuf_copypkthdr/index.html b/os/core_os/mbuf/_os_mbuf_copypkthdr/index.html
deleted file mode 100644
index da45951..0000000
--- a/os/core_os/mbuf/_os_mbuf_copypkthdr/index.html
+++ /dev/null
@@ -1,729 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
- <link rel="canonical" href="http://mynewt.apache.org/os/core_os/mbuf/_os_mbuf_copypkthdr/">
- <link rel="shortcut icon" href="../../../../img/favicon.ico">
-
- <title>_os_mbuf_copypkthdr - Apache Mynewt</title>
-
- <link href="../../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
- <link href="../../../../css/font-awesome-4.0.3.css" rel="stylesheet">
- <link rel="stylesheet" href="../../../../css/highlight.css">
- <link href="../../../../css/base.css" rel="stylesheet">
- <link href="../../../../css/custom.css" rel="stylesheet">
- <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
- <link href="../../../../extra.css" rel="stylesheet">
-
- <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
- <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
- <![endif]-->
-
-
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
- ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
- ga('send', 'pageview');
- </script>
-
- </head>
-
-
- <body class="_os_mbuf_copypkthdr">
-
-
- <div class="navbar navbar-default navbar-fixed-top" role="navigation">
- <div class="logo-container">
- <img src="/img/logo.svg">
- </div>
- <div class="container-fluid">
- <!-- Collapsed navigation -->
- <div class="navbar-header">
- <!-- Expander button -->
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
-
- </div>
-
- <!-- Expanded navigation -->
- <div class="navbar-collapse collapse">
- <!-- Main navigation -->
- <ul class="nav navbar-nav navbar-right">
- <li>
- <a href="/">Home</a>
- </li>
- <li>
- <a href="/documentation/">Docs</a>
- </li>
- <li>
- <a href="/download/">Download</a>
- </li>
- <li>
- <a href="/community/">Community</a>
- </li>
- <li>
- <a href="/events/">Events</a>
- </li>
- </ul>
-
- <!-- Search, Navigation and Repo links -->
- <ul class="nav navbar-nav navbar-right">
-
- </ul>
- </div>
- </div>
-</div>
-
- <div class="container-fluid">
-
- <div class="row sm-extra-padding">
- <div class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
- <div class="sidebar-top">
- <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
- <div class="small" role="search">
- <form id ="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
- <div class="form-group">
- <input type="text" name="q" placeholder="Search documentation" />
- <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
- </div>
- </form>
- </div>
- </div>
- <ul class="nav bs-sidenav">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li><a href="
- ../../../get_started/introduction/
-">Apache Mynewt Manual</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../../../get_started/introduction/">Introduction</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../get_started/project1/
-">Get Started</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../tutorials/project2/
-">Tutorials</a>
-
- </li>
-
-
-
-
- <li><a href="
-
-
-
-
- ../../mynewt_os/
-
-
-">OS User Guide</a>
-
- <ul class="current-toc">
-
-
-
- <li><a href="
-
-
- ../../mynewt_os/
-
-">OS Core</a>
-
- <ul class="current-toc">
-
-
-
- <li><a href="
- ../../mynewt_os/
-">OS Fundamentals</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../context_switch/context_switch/
-">Scheduler</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../time/os_time/
-">Time</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../task/task/
-">Tasks</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../event_queue/event_queue/
-">Event Queues</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../semaphore/semaphore/
-">Semaphores</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../mutex/mutex/
-">Mutexes</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../memory_pool/memory_pool/
-">Memory Pools</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../heap/heap/
-">Heap</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../mbuf/
-">Mbufs</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../mbuf/">Overview</a>
- </li>
-
-
-
-
-
- <li><a href="
- ./
-">Functions</a>
-
- <ul class="current-toc">
-
-
-
- <li class="active">
- _os_mbuf_copypkthdr
- </li>
-
-
-
-
-
- <li>
- <a href="../_os_msys_find_pool/">_os_msys_find_pool.md</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_adj/">os_mbuf_adj</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_append/">os_mbuf_append</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_concat/">os_mbuf_concat</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_dup/">os_mbuf_dup</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_extend/">os_mbuf_extend</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_free/">os_mbuf_free</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_get/">os_mbuf_get</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_off/">os_mbuf_off</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mqueue_get/">os_mqueue_get</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mqueue_init/">os_mqueue_init</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mqueue_put/">os_mqueue_put</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_msys_get/">os_msys_get</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_msys_get_pkthdr/">os_msys_get_pkthdr</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_msys_register/">os_msys_register</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_msys_reset/">os_msys_reset</a>
- </li>
-
-
-
- </ul>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
- ../../sanity/sanity/
-">Sanity</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../callout/callout/
-">Callouts</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../port_os/">Porting to other Platforms</a>
- </li>
-
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/console/console/
-">Console</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/shell/shell/
-">Shell</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/bootloader/bootloader/
-">Bootloader</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../../modules/filesystem/">File System Abstraction</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../../../modules/nffs/">Newtron Flash File System</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../modules/testutil/testutil/
-">Test Utilities</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/imgmgr/imgmgr/
-">Image Manager</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../../modules/baselibc/">Baselibc library</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../modules/elua/elua/
-">Embedded Lua</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/json/json/
-">JSON</a>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
-
-
- ../../../../network/ble/ble_intro/
-
-">Networking User Guide</a>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
-
-
- <li><a href="
- ../../../../newt/newt_intro/
-">Newt Tool Manual</a>
-
- </li>
-
-
-
-
-
-
- <li><a href="
- ../../../../newtmgr/overview/
-">Newt Manager Manual</a>
-
- </li>
-
-
-
- </ul>
-</div></div>
-
- <div class="show-sidebar-container">
- <button class="show-sidebar">Docs Menu</button>
- </div>
-
- <div class="col-md-9 documentation-viewer" role="main">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="../../../..">Docs</a> »</li>
-
-
-
- <li>Mbufs »</li>
-
-
-
- <li>Functions »</li>
-
-
-
- <li>_os_mbuf_copypkthdr</li>
- <li class="wy-breadcrumbs-aside">
-
- </li>
- </ul>
- <hr/>
-</div>
-
-
-
- </div>
- </div>
-
- <div class="row">
- <footer>
- <div class="row">
- <div class="col-md-12">
-
- <p class="copyright">Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
-
- </div>
- </div>
- <div class="copyright-logos">
- <div class="row">
- <div class="col-xs-6 text-right">
- <img src="/img/apache-feather.png" alt="Apache" title="Apache">
- </div>
- <div class="col-xs-6 text-left">
- <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <small class="footnote">
- MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
- </small>
- </div>
- </div>
-</footer>
- </div>
- </div>
-
- <script src="../../../../js/jquery-1.10.2.min.js"></script>
- <script src="../../../../js/bootstrap-3.0.3.min.js"></script>
- <script src="../../../../js/highlight.pack.js"></script>
- <script src="../../../../js/base.js"></script>
- <script src="../../../../js/custom.js"></script>
-
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/370712c1/os/core_os/mbuf/_os_msys_find_pool/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/mbuf/_os_msys_find_pool/index.html b/os/core_os/mbuf/_os_msys_find_pool/index.html
deleted file mode 100644
index 9576bf3..0000000
--- a/os/core_os/mbuf/_os_msys_find_pool/index.html
+++ /dev/null
@@ -1,729 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
- <link rel="canonical" href="http://mynewt.apache.org/os/core_os/mbuf/_os_msys_find_pool/">
- <link rel="shortcut icon" href="../../../../img/favicon.ico">
-
- <title>_os_msys_find_pool.md - Apache Mynewt</title>
-
- <link href="../../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
- <link href="../../../../css/font-awesome-4.0.3.css" rel="stylesheet">
- <link rel="stylesheet" href="../../../../css/highlight.css">
- <link href="../../../../css/base.css" rel="stylesheet">
- <link href="../../../../css/custom.css" rel="stylesheet">
- <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
- <link href="../../../../extra.css" rel="stylesheet">
-
- <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
- <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
- <![endif]-->
-
-
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
- ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
- ga('send', 'pageview');
- </script>
-
- </head>
-
-
- <body class="_os_msys_find_pool.md">
-
-
- <div class="navbar navbar-default navbar-fixed-top" role="navigation">
- <div class="logo-container">
- <img src="/img/logo.svg">
- </div>
- <div class="container-fluid">
- <!-- Collapsed navigation -->
- <div class="navbar-header">
- <!-- Expander button -->
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
-
- </div>
-
- <!-- Expanded navigation -->
- <div class="navbar-collapse collapse">
- <!-- Main navigation -->
- <ul class="nav navbar-nav navbar-right">
- <li>
- <a href="/">Home</a>
- </li>
- <li>
- <a href="/documentation/">Docs</a>
- </li>
- <li>
- <a href="/download/">Download</a>
- </li>
- <li>
- <a href="/community/">Community</a>
- </li>
- <li>
- <a href="/events/">Events</a>
- </li>
- </ul>
-
- <!-- Search, Navigation and Repo links -->
- <ul class="nav navbar-nav navbar-right">
-
- </ul>
- </div>
- </div>
-</div>
-
- <div class="container-fluid">
-
- <div class="row sm-extra-padding">
- <div class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
- <div class="sidebar-top">
- <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
- <div class="small" role="search">
- <form id ="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
- <div class="form-group">
- <input type="text" name="q" placeholder="Search documentation" />
- <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
- </div>
- </form>
- </div>
- </div>
- <ul class="nav bs-sidenav">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li><a href="
- ../../../get_started/introduction/
-">Apache Mynewt Manual</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../../../get_started/introduction/">Introduction</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../get_started/project1/
-">Get Started</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../tutorials/project2/
-">Tutorials</a>
-
- </li>
-
-
-
-
- <li><a href="
-
-
-
-
- ../../mynewt_os/
-
-
-">OS User Guide</a>
-
- <ul class="current-toc">
-
-
-
- <li><a href="
-
-
- ../../mynewt_os/
-
-">OS Core</a>
-
- <ul class="current-toc">
-
-
-
- <li><a href="
- ../../mynewt_os/
-">OS Fundamentals</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../context_switch/context_switch/
-">Scheduler</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../time/os_time/
-">Time</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../task/task/
-">Tasks</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../event_queue/event_queue/
-">Event Queues</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../semaphore/semaphore/
-">Semaphores</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../mutex/mutex/
-">Mutexes</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../memory_pool/memory_pool/
-">Memory Pools</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../heap/heap/
-">Heap</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../mbuf/
-">Mbufs</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../mbuf/">Overview</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../_os_mbuf_copypkthdr/
-">Functions</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../_os_mbuf_copypkthdr/">_os_mbuf_copypkthdr</a>
- </li>
-
-
-
-
-
- <li class="active">
- _os_msys_find_pool.md
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_adj/">os_mbuf_adj</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_append/">os_mbuf_append</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_concat/">os_mbuf_concat</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_dup/">os_mbuf_dup</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_extend/">os_mbuf_extend</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_free/">os_mbuf_free</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_get/">os_mbuf_get</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_off/">os_mbuf_off</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mqueue_get/">os_mqueue_get</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mqueue_init/">os_mqueue_init</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_mqueue_put/">os_mqueue_put</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_msys_get/">os_msys_get</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_msys_get_pkthdr/">os_msys_get_pkthdr</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_msys_register/">os_msys_register</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_msys_reset/">os_msys_reset</a>
- </li>
-
-
-
- </ul>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
- ../../sanity/sanity/
-">Sanity</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../callout/callout/
-">Callouts</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../port_os/">Porting to other Platforms</a>
- </li>
-
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/console/console/
-">Console</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/shell/shell/
-">Shell</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/bootloader/bootloader/
-">Bootloader</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../../modules/filesystem/">File System Abstraction</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../../../modules/nffs/">Newtron Flash File System</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../modules/testutil/testutil/
-">Test Utilities</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/imgmgr/imgmgr/
-">Image Manager</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../../modules/baselibc/">Baselibc library</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../modules/elua/elua/
-">Embedded Lua</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/json/json/
-">JSON</a>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
-
-
- ../../../../network/ble/ble_intro/
-
-">Networking User Guide</a>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
-
-
- <li><a href="
- ../../../../newt/newt_intro/
-">Newt Tool Manual</a>
-
- </li>
-
-
-
-
-
-
- <li><a href="
- ../../../../newtmgr/overview/
-">Newt Manager Manual</a>
-
- </li>
-
-
-
- </ul>
-</div></div>
-
- <div class="show-sidebar-container">
- <button class="show-sidebar">Docs Menu</button>
- </div>
-
- <div class="col-md-9 documentation-viewer" role="main">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="../../../..">Docs</a> »</li>
-
-
-
- <li>Mbufs »</li>
-
-
-
- <li>Functions »</li>
-
-
-
- <li>_os_msys_find_pool.md</li>
- <li class="wy-breadcrumbs-aside">
-
- </li>
- </ul>
- <hr/>
-</div>
-
-
-
- </div>
- </div>
-
- <div class="row">
- <footer>
- <div class="row">
- <div class="col-md-12">
-
- <p class="copyright">Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
-
- </div>
- </div>
- <div class="copyright-logos">
- <div class="row">
- <div class="col-xs-6 text-right">
- <img src="/img/apache-feather.png" alt="Apache" title="Apache">
- </div>
- <div class="col-xs-6 text-left">
- <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <small class="footnote">
- MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
- </small>
- </div>
- </div>
-</footer>
- </div>
- </div>
-
- <script src="../../../../js/jquery-1.10.2.min.js"></script>
- <script src="../../../../js/bootstrap-3.0.3.min.js"></script>
- <script src="../../../../js/highlight.pack.js"></script>
- <script src="../../../../js/base.js"></script>
- <script src="../../../../js/custom.js"></script>
-
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/370712c1/os/core_os/mbuf/mbuf/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/mbuf/mbuf/index.html b/os/core_os/mbuf/mbuf/index.html
index 8114f6c..d449915 100644
--- a/os/core_os/mbuf/mbuf/index.html
+++ b/os/core_os/mbuf/mbuf/index.html
@@ -145,7 +145,7 @@
<li><a href="
- ../../../tutorials/project2/
+ ../../../tutorials/STM32F303/
">Tutorials</a>
</li>
@@ -276,8 +276,8 @@
<li><a href="
- ../_os_mbuf_copypkthdr/
-">Functions</a>
+ ../OS_MBUF_PKTHDR/
+">Functions/Macros</a>
</li>
@@ -290,6 +290,15 @@
<li><a href="
+ ../../mqueue/mqueue/
+">MQueue</a>
+
+ </li>
+
+
+
+
+ <li><a href="
../../sanity/sanity/
">Sanity</a>
@@ -481,16 +490,267 @@
</div>
<h1 id="mbufs">Mbufs<a class="headerlink" href="#mbufs" title="Permanent link">¶</a></h1>
-<p>Insert synopsis here</p>
-<h2 id="description">Description<a class="headerlink" href="#description" title="Permanent link">¶</a></h2>
-<p>Describe OS feature here </p>
-<h2 id="data-structures">Data structures<a class="headerlink" href="#data-structures" title="Permanent link">¶</a></h2>
-<p>Replace this with the list of data structures used, why, any neat features</p>
-<h2 id="list-of-functions">List of Functions<a class="headerlink" href="#list-of-functions" title="Permanent link">¶</a></h2>
-<p>The functions available in mbuf are:</p>
+<p>The mbuf (short for memory buffer) is a common concept in networking stacks. The mbuf is used to hold packet data as it traverses the stack. The mbuf also generally stores header information or other networking stack information that is carried around with the packet. The mbuf and its associated library of functions were developed to make common networking stack operations (like stripping and adding protocol headers) efficient and as copy-free as possible.</p>
+<p>In its simplest form, an mbuf is a memory block with some space reserved for internal information and a pointer which is used to "chain" memory blocks together in order to create a "packet". This is a very important aspect of the mbuf: the ability to chain mbufs together to create larger "packets" (chains of mbufs).</p>
+<h2 id="why-use-mbufs">Why use mbufs?<a class="headerlink" href="#why-use-mbufs" title="Permanent link">¶</a></h2>
+<p>The main reason is to conserve memory. Consider a networking protocol that generally sends small packets but occasionally sends large ones. The Bluetooth Low Energy (BLE) protocol is one such example. A flat buffer would need to be sized so that the maximum packet size could be contained by the buffer. With the mbuf, a number of mbufs can be chained together so that the occasional large packet can be handled while leaving more packet buffers available to the networking stack for smaller packets.</p>
+<h2 id="packet-header-mbuf">Packet Header mbuf<a class="headerlink" href="#packet-header-mbuf" title="Permanent link">¶</a></h2>
+<p>Not all mbufs are created equal. The first mbuf in a chain of mbufs is a special mbuf called a "packet header mbuf". The reason that this mbuf is special is that it contains the length of all the data contained by the chain of mbufs (the packet length, in other words). The packet header mbuf may also contain a user defined structure (called a "user header") so that networking protocol specific information can be conveyed to various layers of the networking stack. Any mbufs that are part of the packet (i.e. in the mbuf chain but not the first one) are "normal" (i.e. non-packet header) mbufs. A normal mbuf does not have any packet header or user packet header structures in them; they only contain the basic mbuf header (<code>struct os_mbuf</code>). Figure 1 illustrates these two types of mbufs. Note that the numbers/text in parentheses denote the size of the structures/elements (in bytes) and that MBLEN is the memory block length of the memory pool used by the mbuf pool.</p>
+<p><img alt="Packet header mbuf" src="../pics/mbuf_fig1.png" /></p>
+<h2 id="normal-mbuf">Normal mbuf<a class="headerlink" href="#normal-mbuf" title="Permanent link">¶</a></h2>
+<p>Now let's take a deeper dive into the mbuf structure. Figure 2 illustrates a normal mbuf and breaks out the various fields in the <code>os_mbuf</code> structure. </p>
+<ul>
+<li>The <em>om_data</em> field is a pointer to where the data starts inside the data buffer. Typically, mbufs that are allocated from the mbuf pool (discussed later) have their om_data pointer set to the start of the data buffer but there are cases where this may not be desirable (added a protocol header to a packet, for example). </li>
+<li>The <em>om_flags</em> field is a set of flags used internally by the mbuf library. Currently, no flags have been defined. </li>
+<li>The <em>om_pkthdr_len</em> field is the total length of all packet headers in the mbuf. For normal mbufs this is set to 0 as there is no packet or user packet headers. For packet header mbufs, this would be set to the length of the packet header structure (16) plus the size of the user packet header (if any). Note that it is this field which differentiates packet header mbufs from normal mbufs (i.e. if <em>om_pkthdr_len</em> is zero, this is a normal mbuf; otherwise it is a packet header mbuf). </li>
+<li>The <em>om_len</em> field contains the amount of user data in the data buffer. When initially allocated, this field is 0 as there is no user data in the mbuf. </li>
+<li>The <em>omp_pool</em> field is a pointer to the pool from which this mbuf has been allocated. This is used internally by the mbuf library. </li>
+<li>The <em>omp_next</em> field is a linked list element which is used to chain mbufs.</li>
+</ul>
+<p>Figure 2 also shows a normal mbuf with actual values in the <code>os_mbuf</code> structure. This mbuf starts at address 0x1000 and is 256 bytes in total length. In this example, the user has copied 33 bytes into the data buffer starting at address 0x1010 (this is where om_data points). Note that the packet header length in this mbuf is 0 as it is not a packet header mbuf.</p>
+<p><img alt="OS mbuf structure" src="../pics/mbuf_fig2.png" /></p>
+<p>Figure 3 illustrates the packet header mbuf along with some chained mbufs (i.e a "packet"). In this example, the user header structure is defined to be 8 bytes. Note that in figure 3 we show a number of different mbufs with varying <em>om_data</em> pointers and lengths since we want to show various examples of valid mbufs. For all the mbufs (both packet header and normal ones) the total length of the memory block is 128 bytes.</p>
+<p><img alt="Packet" src="../pics/mbuf_fig3.png" /></p>
+<h2 id="mbuf-pools">Mbuf pools<a class="headerlink" href="#mbuf-pools" title="Permanent link">¶</a></h2>
+<p>Mbufs are collected into "mbuf pools" much like memory blocks. The mbuf pool itself contains a pointer to a memory pool. The memory blocks in this memory pool are the actual mbufs; both normal and packet header mbufs. Thus, the memory block (and corresponding memory pool) must be sized correctly. In other words, the memory blocks which make up the memory pool used by the mbuf pool must be at least: sizeof(struct os_mbuf) + sizeof(struct os_mbuf_pkthdr) + sizeof(struct user_defined_header) + desired minimum data buffer length. For example, if the developer wants mbufs to contain at least 64 bytes of user data and they have a user header of 12 bytes, the size of the memory block would be (at least): 64 + 12 + 16 + 8, or 100 bytes. Yes, this is a fair amount of overhead. However, the flexibility provided by the mbuf library usually outweighs overhead concerns.</p>
+<h2 id="create-mbuf-pool">Create mbuf pool<a class="headerlink" href="#create-mbuf-pool" title="Permanent link">¶</a></h2>
+<p>Creating an mbuf pool is fairly simple: create a memory pool and then create the mbuf pool using that memory pool. Once the developer has determined the size of the user data needed per mbuf (this is based on the application/networking stack and is outside the scope of this discussion) and the size of the user header (if any), the memory blocks can be sized. In the example shown below, the application requires 64 bytes of user data per mbuf and also allocates a user header (called struct user_hdr). Note that we do not show the user header data structure as there really is no need; all we need to do is to account for it when creating the memory pool. In the example, we use the macro <em>MBUF_PKTHDR_OVERHEAD</em> to denote the amount of packet header overhead per mbuf and <em>MBUF_MEMBLOCK_OVERHEAD</em> to denote the total amount of overhead required per memory block. The macro <em>MBUF_BUF_SIZE</em> is used to denote the amount of payload that the application requires (aligned on
a 32-bit boundary in this case). All this leads to the total memory block size required, denoted by the macro <em>MBUF_MEMBLOCK_OVERHEAD</em>.</p>
+<pre><code class="no-highlight">
+#define MBUF_PKTHDR_OVERHEAD sizeof(struct os_mbuf_pkthdr) + sizeof(struct user_hdr)
+#define MBUF_MEMBLOCK_OVERHEAD sizeof(struct os_mbuf) + MBUF_PKTHDR_OVERHEAD
+
+#define MBUF_NUM_MBUFS (32)
+#define MBUF_PAYLOAD_SIZE (64)
+#define MBUF_BUF_SIZE OS_ALIGN(MBUF_PAYLOAD_SIZE, 4)
+#define MBUF_MEMBLOCK_SIZE (MBUF_BUF_SIZE + MBUF_MEMBLOCK_OVERHEAD)
+#define MBUF_MEMPOOL_SIZE OS_MEMPOOL_SIZE(MBUF_NUM_MBUFS, MBUF_MEMBLOCK_SIZE)
+
+struct os_mbuf_pool g_mbuf_pool;
+struct os_mempool g_mbuf_mempool;
+os_membuf_t g_mbuf_buffer[MBUF_MEMPOOL_SIZE];
+
+void
+create_mbuf_pool(void)
+{
+ int rc;
+
+ rc = os_mempool_init(&g_mbuf_mempool, MBUF_NUM_MBUFS,
+ MBUF_MEMBLOCK_SIZE, &g_mbuf_buffer[0], "mbuf_pool");
+ assert(rc == 0);
+
+ rc = os_mbuf_pool_init(&g_mbuf_pool, &g_mbuf_mempool, MBUF_MEMBLOCK_SIZE,
+ MBUF_NUM_MBUFS);
+ assert(rc == 0);
+}
+
+</code></pre>
+
+<h2 id="using-mbufs">Using mbufs<a class="headerlink" href="#using-mbufs" title="Permanent link">¶</a></h2>
+<p>The following examples illustrate typical mbuf usage. There are two basic mbuf allocation API: <code>os_mbuf_get()</code> and <code>os_mbuf_get_pkthdr()</code>. The first API obtains a normal mbuf whereas the latter obtains a packet header mbuf. Typically, application developers use <code>os_mbuf_get_pkthdr()</code> and rarely, if ever, need to call <code>os_mbuf_get()</code> as the rest of the mbuf API (e.g. <code>os_mbuf_append()</code>, <code>os_mbuf_copyinto()</code>, etc.) typically deal with allocating and chaining mbufs. It is recommended to use the provided API to copy data into/out of mbuf chains and/or manipulate mbufs.</p>
+<p>In <code>example1</code>, the developer creates a packet and then sends the packet to a networking interface. The code sample also provides an example of copying data out of an mbuf as well as use of the "pullup" api (another very common mbuf api).</p>
+<pre><code class="no-highlight">
+void
+mbuf_usage_example1(uint8_t *mydata, int mydata_length)
+{
+ int rc;
+ struct os_mbuf *om;
+
+ /* get a packet header mbuf */
+ om = os_mbuf_get_pkthdr(&g_mbuf_pool, sizeof(struct user_hdr));
+ if (om) {
+ /*
+ * Copy user data into mbuf. NOTE: if mydata_length is greater than the
+ * mbuf payload size (64 bytes using above example), mbufs are allocated
+ * and chained together to accommodate the total packet length.
+ */
+ rc = os_mbuf_copyinto(om, 0, mydata, len);
+ if (rc) {
+ /* Error! Could not allocate enough mbufs for total packet length */
+ return -1;
+ }
+
+ /* Send packet to networking interface */
+ send_pkt(om);
+ }
+}
+</code></pre>
+
+<p>In <code>example2</code> we show use of the pullup api as this illustrates some of the typical pitfalls developers encounter when using mbufs. The first pitfall is one of alignment/padding. Depending on the processor and/or compiler, the sizeof() a structure may vary. Thus, the size of <em>my_protocol_header</em> may be different inside the packet data of the mbuf than the size of the structure on the stack or as a global variable, for instance. While some networking protcols may align protocol information on convenient processor boundaries many others try to conserve bytes "on the air" (i.e inside the packet data). Typical methods used to deal with this are "packing" the structure (i.e. force compiler to not pad) or creating protocol headers that do not require padding. <code>example2</code> assumes that one of these methods was used when defining the <em>my_protocol_header</em> structure.</p>
+<p>Another common pitfall occurs around endianness. A network protocol may be little endian or big endian; it all depends on the protocol specification. Processors also have an endianness; this means that the developer has to be careful that the processor endianness and the protocol endianness are handled correctly. In <code>example2</code>, some common networking functions are used: <code>ntohs()</code> and <code>ntohl()</code>. These are shorthand for "network order to host order, short" and "network order to host order, long". Basically, these functions convert data of a certain size (i.e. 16 bits, 32 bits, etc) to the endianness of the host. Network byte order is big-endian (most significant byte first), so these functions convert big-endian byte order to host order (thus, the implementation of these functions is host dependent). Note that the BLE networking stack "on the air" format is least signigicant byte first (i.e. little endian), so a "bletoh" function would have to take
little endian format and convert to host format.</p>
+<p>A long story short: the developer must take care when copying structure data to/from mbufs and flat buffers!</p>
+<p>A final note: these examples assume the same mbuf struture and definitions used in the first example. </p>
+<pre><code class="no-highlight">void
+mbuf_usage_example2(struct mbuf *rxpkt)
+{
+ int rc;
+ uint8_t packet_data[16];
+ struct mbuf *om;
+ struct my_protocol_header *phdr;
+
+ /* Make sure that "my_protocol_header" bytes are contiguous in mbuf */
+ om = os_mbuf_pullup(&g_mbuf_pool, sizeof(struct my_protocol_header));
+ if (!om) {
+ /* Not able to pull up data into contiguous area */
+ return -1;
+ }
+
+ /*
+ * Get the protocol information from the packet. In this example we presume that we
+ * are interested in protocol types that are equal to MY_PROTOCOL_TYPE, are not zero
+ * length, and have had some time in flight.
+ */
+ phdr = OS_MBUF_DATA(om, struct my_protocol_header *);
+ type = ntohs(phdr->prot_type);
+ length = ntohs(phdr->prot_length);
+ time_in_flight = ntohl(phdr->prot_tif);
+
+ if ((type == MY_PROTOCOL_TYPE) && (length > 0) && (time_in_flight > 0)) {
+ rc = os_mbuf_copydata(rxpkt, sizeof(struct my_protocol_header), 16, packet_data);
+ if (!rc) {
+ /* Success! Perform operations on packet data */
+ <... user code here ...>
+ }
+ }
+
+ /* Free passed in packet (mbuf chain) since we dont need it anymore */
+ os_mbuf_free_chain(om);
+}
+
+</code></pre>
+
+<p><br></p>
+<h1 id="msys">Msys<a class="headerlink" href="#msys" title="Permanent link">¶</a></h1>
+<p>msys stands for "system mbufs" and is set of API built on top of the mbuf code. The basic idea behind msys is the following. The developer can create different size mbuf pools and register them with msys. The application then allocates mbufs using the msys API (as opposed to the mbuf API). The msys code will choose the mbuf pool with the smallest mbufs that can accommodate the requested size. </p>
+<p>Let us walk through an example where the user registers three mbuf pools with msys: one with 32 byte mbufs, one with 256 and one with 2048. If the user requests an mbuf with 10 bytes, the 32-byte mbuf pool is used. If the request is for 33 bytes the 256 byte mbuf pool is used. If an mbuf data size is requested that is larger than any of the pools (say, 4000 bytes) the largest pool is used. While this behaviour may not be optimal in all cases that is the currently implemented behaviour. All this means is that the user is not guaranteed that a single mbuf can hold the requested data.</p>
+<p>The msys code will not allocate an mbuf from a larger pool if the chosen mbuf pool is empty. Similarly, the msys code will not chain together a number of smaller mbufs to accommodate the requested size. While this behaviour may change in future implementations the current code will simply return NULL. Using the above example, say the user requests 250 bytes. The msys code chooses the appropriate pool (i.e. the 256 byte mbuf pool) and attempts to allocate an mbuf from that pool. If that pool is empty, NULL is returned even though the 32 and 2048 byte pools are not empty.</p>
+<p>Note that no added descriptions on how to use the msys API are presented here (other than in the API descriptions themselves) as the msys API is used in exactly the same manner as the mbuf API. The only difference is that mbuf pools are added to msys by calling <code>os_msys_register().</code></p>
+<p><br> </p>
+<h2 id="data-structures">Data Structures<a class="headerlink" href="#data-structures" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">struct os_mbuf_pool {
+ uint16_t omp_databuf_len;
+ uint16_t omp_mbuf_count;
+ struct os_mempool *omp_pool;
+ STAILQ_ENTRY(os_mbuf_pool) omp_next;
+};
+</code></pre>
+
+<table>
+<thead>
+<tr>
+<th><strong>Element</strong></th>
+<th><strong>Description</strong></th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>omp_databuf_len</td>
+<td>The length, in bytes, of the "data buffer" of the mbuf. The data buffer of the mbuf is everything except the os_mbuf structure (which is present in all types of mbufs)</td>
+</tr>
+<tr>
+<td>omp_mbuf_count</td>
+<td>Total number of mbufs in the pool when allocated. This is NOT the number of free mbufs in the pool!</td>
+</tr>
+<tr>
+<td>omp_pool</td>
+<td>The memory pool from which the mbufs are allocated</td>
+</tr>
+<tr>
+<td>omp_next</td>
+<td>This is a linked list pointer which chains memory pools. It is used by the system memory pool library</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<pre><code class="no-highlight">struct os_mbuf_pkthdr {
+ uint16_t omp_len;
+ uint16_t omp_flags;
+ STAILQ_ENTRY(os_mbuf_pkthdr) omp_next;
+};
+</code></pre>
+
+<table>
+<thead>
+<tr>
+<th><strong>Element</strong></th>
+<th><strong>Description</strong></th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>omp_len</td>
+<td>Length, in bytes, of the "packet". This is the sum of the user data in all the mbufs chained to the packet header mbuf (including the packet header mbuf)</td>
+</tr>
+<tr>
+<td>omp_flags</td>
+<td>Packet header flags.</td>
+</tr>
+<tr>
+<td>omp_next</td>
+<td>Linked list pointer to chain "packets". This can be used to add mbuf chains to a queue or linked list and is there for convenience.</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<pre><code class="no-highlight">struct os_mbuf {
+ uint8_t *om_data;
+ uint8_t om_flags;
+ uint8_t om_pkthdr_len;
+ uint16_t om_len;
+ struct os_mbuf_pool *om_omp;
+ SLIST_ENTRY(os_mbuf) om_next;
+ uint8_t om_databuf[0];
+};
+</code></pre>
+
+<table>
+<thead>
+<tr>
+<th><strong>Element</strong></th>
+<th><strong>Description</strong></th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>om_data</td>
+<td>Pointer to start of user data in mbuf data buffer</td>
+</tr>
+<tr>
+<td>om_flags</td>
+<td>mbuf flags field. Currently all flags unused.</td>
+</tr>
+<tr>
+<td>om_pkthdr_len</td>
+<td>The total length of all packet headers in the mbuf (mbuf packet header plus user packet header), in bytes</td>
+</tr>
+<tr>
+<td>om_len</td>
+<td>The length of the user data contained in this mbuf, in bytes</td>
+</tr>
+<tr>
+<td>om_omp</td>
+<td>Memory pool pointer. This is the mbuf pool from which this mbuf was allocated.</td>
+</tr>
+<tr>
+<td>om_next</td>
+<td>Pointer to next mbuf in packet chain</td>
+</tr>
+<tr>
+<td>om_databuf</td>
+<td>mbuf data buffer (accessor to start of mbuf data buffer). Note that the mbuf data buffer refers to the start of either the user data in normal mbufs or the start of the os mbuf packet header for packet header mbufs</td>
+</tr>
+</tbody>
+</table>
+<h2 id="list-of-functionsmacros">List of Functions/Macros<a class="headerlink" href="#list-of-functionsmacros" title="Permanent link">¶</a></h2>
+<p>The functions/macros available in mbuf are:</p>
<ul>
-<li><a href="../_os_mbuf_copypkthdr/">_os_mbuf_copypkthdr</a></li>
-<li><a href="../_os_msys_find_pool/">_os_msys_find_pool</a></li>
+<li><a href="../OS_MBUF_PKTHDR/">OS_MBUF_PKTHDR</a></li>
+<li><a href="../OS_MBUF_PKTHDR_TO_MBUF/">OS_MBUF_PKTHDR_TO_MBUF</a></li>
+<li><a href="../OS_MBUF_PKTLEN/">OS_MBUF_PKTLEN</a></li>
+<li><a href="../OS_MBUF_DATA/">OS_MBUF_DATA</a></li>
+<li><a href="../OS_MBUF_USRHDR/">OS_MBUF_USRHDR</a></li>
+<li><a href="../OS_MBUF_USRHDR_LEN/">OS_MBUF_USRHDR_LEN</a></li>
+<li><a href="../OS_MBUF_LEADINGSPACE/">OS_MBUF_LEADINGSPACE</a></li>
+<li><a href="../OS_MBUF_TRAILINGSPACE/">OS_MBUF_TRAILINGSPACE</a></li>
<li><a href="../os_mbuf_adj/">os_mbuf_adj</a></li>
<li><a href="../os_mbuf_append/">os_mbuf_append</a></li>
<li><a href="../os_mbuf_concat/">os_mbuf_concat</a></li>
@@ -498,7 +758,6 @@
<li><a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a></li>
<li><a href="../os_mbuf_dup/">os_mbuf_dup</a></li>
<li><a href="../os_mbuf_extend/">os_mbuf_extend</a></li>
-<li><a href="../os_mbuf_free/">os_mbuf_free</a></li>
<li><a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a></li>
<li><a href="../os_mbuf_get/">os_mbuf_get</a></li>
<li><a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a></li>
@@ -507,9 +766,6 @@
<li><a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a></li>
<li><a href="../os_mbuf_prepend/">os_mbuf_prepend</a></li>
<li><a href="../os_mbuf_pullup/">os_mbuf_pullup</a></li>
-<li><a href="../os_mqueue_get/">os_mqueue_get</a></li>
-<li><a href="../os_mqueue_init/">os_mqueue_init</a></li>
-<li><a href="../os_mqueue_put/">os_mqueue_put</a></li>
<li><a href="../os_msys_get/">os_msys_get</a></li>
<li><a href="../os_msys_get_pkthdr/">os_msys_get_pkthdr</a></li>
<li><a href="../os_msys_register/">os_msys_register</a></li>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/370712c1/os/core_os/mbuf/os_mbuf_adj/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/mbuf/os_mbuf_adj/index.html b/os/core_os/mbuf/os_mbuf_adj/index.html
index 527e8e2..4d99208 100644
--- a/os/core_os/mbuf/os_mbuf_adj/index.html
+++ b/os/core_os/mbuf/os_mbuf_adj/index.html
@@ -145,7 +145,7 @@
<li><a href="
- ../../../tutorials/project2/
+ ../../../tutorials/STM32F303/
">Tutorials</a>
</li>
@@ -276,15 +276,15 @@
<li><a href="
- ../_os_mbuf_copypkthdr/
-">Functions</a>
+ ../OS_MBUF_PKTHDR/
+">Functions/Macros</a>
<ul class="current-toc">
<li>
- <a href="../_os_mbuf_copypkthdr/">_os_mbuf_copypkthdr</a>
+ <a href="../OS_MBUF_PKTHDR/">OS_MBUF_PKTHDR</a>
</li>
@@ -292,15 +292,15 @@
<li>
- <a href="../_os_msys_find_pool/">_os_msys_find_pool.md</a>
+ <a href="../OS_MBUF_PKTHDR_TO_MBUF/">OS_MBUF_PKTHDR_TO_MBUF</a>
</li>
- <li class="active">
- os_mbuf_adj
+ <li>
+ <a href="../OS_MBUF_PKTLEN/">OS_MBUF_PKTLEN</a>
</li>
@@ -308,7 +308,7 @@
<li>
- <a href="../os_mbuf_append/">os_mbuf_append</a>
+ <a href="../OS_MBUF_DATA/">OS_MBUF_DATA</a>
</li>
@@ -316,7 +316,7 @@
<li>
- <a href="../os_mbuf_concat/">os_mbuf_concat</a>
+ <a href="../OS_MBUF_USRHDR/">OS_MBUF_USRHDR</a>
</li>
@@ -324,7 +324,7 @@
<li>
- <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
+ <a href="../OS_MBUF_USRHDR_LEN/">OS_MBUF_USRHDR_LEN</a>
</li>
@@ -332,7 +332,7 @@
<li>
- <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
+ <a href="../OS_MBUF_LEADINGSPACE/">OS_MBUF_LEADINGSPACE</a>
</li>
@@ -340,7 +340,15 @@
<li>
- <a href="../os_mbuf_dup/">os_mbuf_dup</a>
+ <a href="../OS_MBUF_TRAILINGSPACE/">OS_MBUF_TRAILINGSPACE</a>
+ </li>
+
+
+
+
+
+ <li class="active">
+ os_mbuf_adj
</li>
@@ -348,7 +356,7 @@
<li>
- <a href="../os_mbuf_extend/">os_mbuf_extend</a>
+ <a href="../os_mbuf_append/">os_mbuf_append</a>
</li>
@@ -356,7 +364,7 @@
<li>
- <a href="../os_mbuf_free/">os_mbuf_free</a>
+ <a href="../os_mbuf_concat/">os_mbuf_concat</a>
</li>
@@ -364,7 +372,7 @@
<li>
- <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
+ <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
</li>
@@ -372,7 +380,7 @@
<li>
- <a href="../os_mbuf_get/">os_mbuf_get</a>
+ <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
</li>
@@ -380,7 +388,7 @@
<li>
- <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
+ <a href="../os_mbuf_dup/">os_mbuf_dup</a>
</li>
@@ -388,7 +396,7 @@
<li>
- <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ <a href="../os_mbuf_extend/">os_mbuf_extend</a>
</li>
@@ -396,7 +404,7 @@
<li>
- <a href="../os_mbuf_off/">os_mbuf_off</a>
+ <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
</li>
@@ -404,7 +412,7 @@
<li>
- <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
+ <a href="../os_mbuf_get/">os_mbuf_get</a>
</li>
@@ -412,7 +420,7 @@
<li>
- <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
+ <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
</li>
@@ -420,7 +428,15 @@
<li>
- <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
+ <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ </li>
+
+
+
+
+
+ <li>
+ <a href="../os_mbuf_off/">os_mbuf_off</a>
</li>
@@ -428,7 +444,7 @@
<li>
- <a href="../os_mqueue_get/">os_mqueue_get</a>
+ <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
</li>
@@ -436,7 +452,7 @@
<li>
- <a href="../os_mqueue_init/">os_mqueue_init</a>
+ <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
</li>
@@ -444,7 +460,7 @@
<li>
- <a href="../os_mqueue_put/">os_mqueue_put</a>
+ <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
</li>
@@ -494,6 +510,15 @@
<li><a href="
+ ../../mqueue/mqueue/
+">MQueue</a>
+
+ </li>
+
+
+
+
+ <li><a href="
../../sanity/sanity/
">Sanity</a>
@@ -672,7 +697,7 @@
- <li>Functions »</li>
+ <li>Functions/Macros »</li>
@@ -684,7 +709,52 @@
<hr/>
</div>
-
+ <h2 id="os_mbuf_adj"><font color="#F2853F" style="font-size:24pt"> os_mbuf_adj</font><a class="headerlink" href="#os_mbuf_adj" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">void os_mbuf_adj(struct os_mbuf *mp, int req_len);
+</code></pre>
+
+<p>Trims <em>req_len</em> bytes from either the head (if positive) or tail (if negative) of an mbuf chain. Adjusts the packet length of the mbuf chain if <em>mp</em> points to a packet header mbuf. When trimming from the head, no mbufs are freed. When trimming from the tail, any mbufs of zero length left at the end of the chain are freed.</p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<table>
+<thead>
+<tr>
+<th>Arguments</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>mp</td>
+<td>Pointer to mbuf. Can be head of a chain of mbufs, a single mbuf or a packet header mbuf</td>
+</tr>
+<tr>
+<td>req_len</td>
+<td>Number of bytes to trim from head or tail of mbuf</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>None</p>
+<h4 id="notes">Notes<a class="headerlink" href="#notes" title="Permanent link">¶</a></h4>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight"> uint16_t pktlen;
+ struct os_mbuf *om;
+ struct my_pkt_header hdr;
+
+ /* Get mbuf chain length */
+ pktlen = OS_MBUF_PKTLEN(om);
+
+ /* Strip header from mbuf chain */
+ os_mbuf_adj(om, sizeof(struct my_pkt_header));
+ pktlen -= sizeof(struct my_pkt_header);
+
+ /* New packet length should be old packet length minus stripped header */
+ assert(pktlen == OS_MBUF_PKTLEN(om));
+</code></pre>
+
+<hr />
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/370712c1/os/core_os/mbuf/os_mbuf_append/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/mbuf/os_mbuf_append/index.html b/os/core_os/mbuf/os_mbuf_append/index.html
index eb0ab63..bf5abef 100644
--- a/os/core_os/mbuf/os_mbuf_append/index.html
+++ b/os/core_os/mbuf/os_mbuf_append/index.html
@@ -145,7 +145,7 @@
<li><a href="
- ../../../tutorials/project2/
+ ../../../tutorials/STM32F303/
">Tutorials</a>
</li>
@@ -276,15 +276,15 @@
<li><a href="
- ../_os_mbuf_copypkthdr/
-">Functions</a>
+ ../OS_MBUF_PKTHDR/
+">Functions/Macros</a>
<ul class="current-toc">
<li>
- <a href="../_os_mbuf_copypkthdr/">_os_mbuf_copypkthdr</a>
+ <a href="../OS_MBUF_PKTHDR/">OS_MBUF_PKTHDR</a>
</li>
@@ -292,7 +292,7 @@
<li>
- <a href="../_os_msys_find_pool/">_os_msys_find_pool.md</a>
+ <a href="../OS_MBUF_PKTHDR_TO_MBUF/">OS_MBUF_PKTHDR_TO_MBUF</a>
</li>
@@ -300,15 +300,15 @@
<li>
- <a href="../os_mbuf_adj/">os_mbuf_adj</a>
+ <a href="../OS_MBUF_PKTLEN/">OS_MBUF_PKTLEN</a>
</li>
- <li class="active">
- os_mbuf_append
+ <li>
+ <a href="../OS_MBUF_DATA/">OS_MBUF_DATA</a>
</li>
@@ -316,7 +316,7 @@
<li>
- <a href="../os_mbuf_concat/">os_mbuf_concat</a>
+ <a href="../OS_MBUF_USRHDR/">OS_MBUF_USRHDR</a>
</li>
@@ -324,7 +324,7 @@
<li>
- <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
+ <a href="../OS_MBUF_USRHDR_LEN/">OS_MBUF_USRHDR_LEN</a>
</li>
@@ -332,7 +332,7 @@
<li>
- <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
+ <a href="../OS_MBUF_LEADINGSPACE/">OS_MBUF_LEADINGSPACE</a>
</li>
@@ -340,7 +340,7 @@
<li>
- <a href="../os_mbuf_dup/">os_mbuf_dup</a>
+ <a href="../OS_MBUF_TRAILINGSPACE/">OS_MBUF_TRAILINGSPACE</a>
</li>
@@ -348,7 +348,15 @@
<li>
- <a href="../os_mbuf_extend/">os_mbuf_extend</a>
+ <a href="../os_mbuf_adj/">os_mbuf_adj</a>
+ </li>
+
+
+
+
+
+ <li class="active">
+ os_mbuf_append
</li>
@@ -356,7 +364,7 @@
<li>
- <a href="../os_mbuf_free/">os_mbuf_free</a>
+ <a href="../os_mbuf_concat/">os_mbuf_concat</a>
</li>
@@ -364,7 +372,7 @@
<li>
- <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
+ <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
</li>
@@ -372,7 +380,7 @@
<li>
- <a href="../os_mbuf_get/">os_mbuf_get</a>
+ <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
</li>
@@ -380,7 +388,7 @@
<li>
- <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
+ <a href="../os_mbuf_dup/">os_mbuf_dup</a>
</li>
@@ -388,7 +396,7 @@
<li>
- <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ <a href="../os_mbuf_extend/">os_mbuf_extend</a>
</li>
@@ -396,7 +404,7 @@
<li>
- <a href="../os_mbuf_off/">os_mbuf_off</a>
+ <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
</li>
@@ -404,7 +412,7 @@
<li>
- <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
+ <a href="../os_mbuf_get/">os_mbuf_get</a>
</li>
@@ -412,7 +420,7 @@
<li>
- <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
+ <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
</li>
@@ -420,7 +428,15 @@
<li>
- <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
+ <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ </li>
+
+
+
+
+
+ <li>
+ <a href="../os_mbuf_off/">os_mbuf_off</a>
</li>
@@ -428,7 +444,7 @@
<li>
- <a href="../os_mqueue_get/">os_mqueue_get</a>
+ <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
</li>
@@ -436,7 +452,7 @@
<li>
- <a href="../os_mqueue_init/">os_mqueue_init</a>
+ <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
</li>
@@ -444,7 +460,7 @@
<li>
- <a href="../os_mqueue_put/">os_mqueue_put</a>
+ <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
</li>
@@ -494,6 +510,15 @@
<li><a href="
+ ../../mqueue/mqueue/
+">MQueue</a>
+
+ </li>
+
+
+
+
+ <li><a href="
../../sanity/sanity/
">Sanity</a>
@@ -672,7 +697,7 @@
- <li>Functions »</li>
+ <li>Functions/Macros »</li>
@@ -684,7 +709,67 @@
<hr/>
</div>
-
+ <h2 id="os_mbuf_append"><font color="#F2853F" style="font-size:24pt"> os_mbuf_append</font><a class="headerlink" href="#os_mbuf_append" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">int os_mbuf_append(struct os_mbuf *om, const void *data, uint16_t len)
+</code></pre>
+
+<p>Appends a data buffer of length <em>len</em> to the end of an mbuf chain, adjusting packet length if <em>om</em> is a packet header mbuf. If not enough trailing space exists at the end of the mbuf chain, mbufs are allocated to hold the data.</p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<table>
+<thead>
+<tr>
+<th>Arguments</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>om</td>
+<td>Pointer to mbuf. Can be head of a chain of mbufs, a single mbuf or a packet header mbuf</td>
+</tr>
+<tr>
+<td>data</td>
+<td>Pointer to data buffer to copy from</td>
+</tr>
+<tr>
+<td>len</td>
+<td>Number of bytes to copy from data buffer to the end of the mbuf</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>0: success<br />
+OS_ENOMEM: Could not allocate enough mbufs to hold data.<br />
+OS_EINVAL: <em>om</em> was NULL on entry.</p>
+<p><br></p>
+<h4 id="notes">Notes<a class="headerlink" href="#notes" title="Permanent link">¶</a></h4>
+<p>If not enough mbufs were available the packet header length of the mbuf may get adjusted even though the entire data buffer was not appended to the end of the mbuf.</p>
+<p><br></p>
+<p>If any mbufs are allocated, they are allocated from the same pool as <em>om</em></p>
+<p><br></p>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight"> int rc;
+ uint16_t pktlen;
+ struct os_mbuf *om;
+ struct my_data_struct my_data;
+
+ /* Get initial packet length */
+ pktlen = OS_MBUF_PKTLEN(om);
+
+ /* Append "my_data" to end of mbuf, freeing mbuf if unable to append all the data */
+ rc = os_mbuf_append(om, &my_data, sizeof(struct my_pkt_header));
+ if (rc) {
+ os_mbuf_free_chain(om);
+ }
+ pktlen += sizeof(struct my_pkt_header);
+
+ /* New packet length should be initial packet length plus length of "my_data" */
+ assert(pktlen == OS_MBUF_PKTLEN(om));
+</code></pre>
+
+<hr />
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/370712c1/os/core_os/mbuf/os_mbuf_concat/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/mbuf/os_mbuf_concat/index.html b/os/core_os/mbuf/os_mbuf_concat/index.html
index b96a1b2..797c47f 100644
--- a/os/core_os/mbuf/os_mbuf_concat/index.html
+++ b/os/core_os/mbuf/os_mbuf_concat/index.html
@@ -145,7 +145,7 @@
<li><a href="
- ../../../tutorials/project2/
+ ../../../tutorials/STM32F303/
">Tutorials</a>
</li>
@@ -276,15 +276,15 @@
<li><a href="
- ../_os_mbuf_copypkthdr/
-">Functions</a>
+ ../OS_MBUF_PKTHDR/
+">Functions/Macros</a>
<ul class="current-toc">
<li>
- <a href="../_os_mbuf_copypkthdr/">_os_mbuf_copypkthdr</a>
+ <a href="../OS_MBUF_PKTHDR/">OS_MBUF_PKTHDR</a>
</li>
@@ -292,7 +292,7 @@
<li>
- <a href="../_os_msys_find_pool/">_os_msys_find_pool.md</a>
+ <a href="../OS_MBUF_PKTHDR_TO_MBUF/">OS_MBUF_PKTHDR_TO_MBUF</a>
</li>
@@ -300,7 +300,7 @@
<li>
- <a href="../os_mbuf_adj/">os_mbuf_adj</a>
+ <a href="../OS_MBUF_PKTLEN/">OS_MBUF_PKTLEN</a>
</li>
@@ -308,15 +308,15 @@
<li>
- <a href="../os_mbuf_append/">os_mbuf_append</a>
+ <a href="../OS_MBUF_DATA/">OS_MBUF_DATA</a>
</li>
- <li class="active">
- os_mbuf_concat
+ <li>
+ <a href="../OS_MBUF_USRHDR/">OS_MBUF_USRHDR</a>
</li>
@@ -324,7 +324,7 @@
<li>
- <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
+ <a href="../OS_MBUF_USRHDR_LEN/">OS_MBUF_USRHDR_LEN</a>
</li>
@@ -332,7 +332,7 @@
<li>
- <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
+ <a href="../OS_MBUF_LEADINGSPACE/">OS_MBUF_LEADINGSPACE</a>
</li>
@@ -340,7 +340,7 @@
<li>
- <a href="../os_mbuf_dup/">os_mbuf_dup</a>
+ <a href="../OS_MBUF_TRAILINGSPACE/">OS_MBUF_TRAILINGSPACE</a>
</li>
@@ -348,7 +348,7 @@
<li>
- <a href="../os_mbuf_extend/">os_mbuf_extend</a>
+ <a href="../os_mbuf_adj/">os_mbuf_adj</a>
</li>
@@ -356,7 +356,15 @@
<li>
- <a href="../os_mbuf_free/">os_mbuf_free</a>
+ <a href="../os_mbuf_append/">os_mbuf_append</a>
+ </li>
+
+
+
+
+
+ <li class="active">
+ os_mbuf_concat
</li>
@@ -364,7 +372,7 @@
<li>
- <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
+ <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
</li>
@@ -372,7 +380,7 @@
<li>
- <a href="../os_mbuf_get/">os_mbuf_get</a>
+ <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
</li>
@@ -380,7 +388,7 @@
<li>
- <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
+ <a href="../os_mbuf_dup/">os_mbuf_dup</a>
</li>
@@ -388,7 +396,7 @@
<li>
- <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ <a href="../os_mbuf_extend/">os_mbuf_extend</a>
</li>
@@ -396,7 +404,7 @@
<li>
- <a href="../os_mbuf_off/">os_mbuf_off</a>
+ <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
</li>
@@ -404,7 +412,7 @@
<li>
- <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
+ <a href="../os_mbuf_get/">os_mbuf_get</a>
</li>
@@ -412,7 +420,7 @@
<li>
- <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
+ <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
</li>
@@ -420,7 +428,15 @@
<li>
- <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
+ <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ </li>
+
+
+
+
+
+ <li>
+ <a href="../os_mbuf_off/">os_mbuf_off</a>
</li>
@@ -428,7 +444,7 @@
<li>
- <a href="../os_mqueue_get/">os_mqueue_get</a>
+ <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
</li>
@@ -436,7 +452,7 @@
<li>
- <a href="../os_mqueue_init/">os_mqueue_init</a>
+ <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
</li>
@@ -444,7 +460,7 @@
<li>
- <a href="../os_mqueue_put/">os_mqueue_put</a>
+ <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
</li>
@@ -494,6 +510,15 @@
<li><a href="
+ ../../mqueue/mqueue/
+">MQueue</a>
+
+ </li>
+
+
+
+
+ <li><a href="
../../sanity/sanity/
">Sanity</a>
@@ -672,7 +697,7 @@
- <li>Functions »</li>
+ <li>Functions/Macros »</li>
@@ -684,7 +709,56 @@
<hr/>
</div>
-
+ <h2 id="os_mbuf_concat"><font color="#F2853F" style="font-size:24pt"> os_mbuf_concat</font><a class="headerlink" href="#os_mbuf_concat" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">void os_mbuf_concat(struct os_mbuf *first, struct os_mbuf *second)
+</code></pre>
+
+<p>Attaches a second mbuf chain onto the end of the first. If the first chain contains a packet header, the header's length is updated. If the second chain has a packet header, its header is cleared.</p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<table>
+<thead>
+<tr>
+<th>Arguments</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>first</td>
+<td>Pointer to first mbuf chain</td>
+</tr>
+<tr>
+<td>second</td>
+<td>Pointer to second mbuf chain</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>None</p>
+<p><br></p>
+<h4 id="notes">Notes<a class="headerlink" href="#notes" title="Permanent link">¶</a></h4>
+<p>No data is copied or moved nor are any mbufs freed.</p>
+<p><br></p>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight"> uint16_t pktlen1;
+ uint16_t pktlen2;
+ struct os_mbuf *pkt1;
+ struct os_mbuf *pkt2;
+
+ /* Get initial packet lengths */
+ pktlen1 = OS_MBUF_PKTLEN(pkt1);
+ pktlen2 = OS_MBUF_PKTLEN(pkt2);
+
+ /* Add pkt2 to end of pkt1 */
+ os_mbuf_concat(pkt1, pkt2);
+
+ /* New packet length should be sum of pkt1 and pkt2 */
+ assert((pktlen1 + pktlen2) == OS_MBUF_PKTLEN(pkt1));
+</code></pre>
+
+<hr />
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/370712c1/os/core_os/mbuf/os_mbuf_copydata/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/mbuf/os_mbuf_copydata/index.html b/os/core_os/mbuf/os_mbuf_copydata/index.html
index f28580f..27e677a 100644
--- a/os/core_os/mbuf/os_mbuf_copydata/index.html
+++ b/os/core_os/mbuf/os_mbuf_copydata/index.html
@@ -145,7 +145,7 @@
<li><a href="
- ../../../tutorials/project2/
+ ../../../tutorials/STM32F303/
">Tutorials</a>
</li>
@@ -276,15 +276,15 @@
<li><a href="
- ../_os_mbuf_copypkthdr/
-">Functions</a>
+ ../OS_MBUF_PKTHDR/
+">Functions/Macros</a>
<ul class="current-toc">
<li>
- <a href="../_os_mbuf_copypkthdr/">_os_mbuf_copypkthdr</a>
+ <a href="../OS_MBUF_PKTHDR/">OS_MBUF_PKTHDR</a>
</li>
@@ -292,7 +292,7 @@
<li>
- <a href="../_os_msys_find_pool/">_os_msys_find_pool.md</a>
+ <a href="../OS_MBUF_PKTHDR_TO_MBUF/">OS_MBUF_PKTHDR_TO_MBUF</a>
</li>
@@ -300,7 +300,7 @@
<li>
- <a href="../os_mbuf_adj/">os_mbuf_adj</a>
+ <a href="../OS_MBUF_PKTLEN/">OS_MBUF_PKTLEN</a>
</li>
@@ -308,7 +308,7 @@
<li>
- <a href="../os_mbuf_append/">os_mbuf_append</a>
+ <a href="../OS_MBUF_DATA/">OS_MBUF_DATA</a>
</li>
@@ -316,15 +316,15 @@
<li>
- <a href="../os_mbuf_concat/">os_mbuf_concat</a>
+ <a href="../OS_MBUF_USRHDR/">OS_MBUF_USRHDR</a>
</li>
- <li class="active">
- os_mbuf_copydata
+ <li>
+ <a href="../OS_MBUF_USRHDR_LEN/">OS_MBUF_USRHDR_LEN</a>
</li>
@@ -332,7 +332,7 @@
<li>
- <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
+ <a href="../OS_MBUF_LEADINGSPACE/">OS_MBUF_LEADINGSPACE</a>
</li>
@@ -340,7 +340,7 @@
<li>
- <a href="../os_mbuf_dup/">os_mbuf_dup</a>
+ <a href="../OS_MBUF_TRAILINGSPACE/">OS_MBUF_TRAILINGSPACE</a>
</li>
@@ -348,7 +348,7 @@
<li>
- <a href="../os_mbuf_extend/">os_mbuf_extend</a>
+ <a href="../os_mbuf_adj/">os_mbuf_adj</a>
</li>
@@ -356,7 +356,7 @@
<li>
- <a href="../os_mbuf_free/">os_mbuf_free</a>
+ <a href="../os_mbuf_append/">os_mbuf_append</a>
</li>
@@ -364,7 +364,15 @@
<li>
- <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
+ <a href="../os_mbuf_concat/">os_mbuf_concat</a>
+ </li>
+
+
+
+
+
+ <li class="active">
+ os_mbuf_copydata
</li>
@@ -372,7 +380,7 @@
<li>
- <a href="../os_mbuf_get/">os_mbuf_get</a>
+ <a href="../os_mbuf_copyinto/">os_mbuf_copyinto</a>
</li>
@@ -380,7 +388,7 @@
<li>
- <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
+ <a href="../os_mbuf_dup/">os_mbuf_dup</a>
</li>
@@ -388,7 +396,7 @@
<li>
- <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ <a href="../os_mbuf_extend/">os_mbuf_extend</a>
</li>
@@ -396,7 +404,7 @@
<li>
- <a href="../os_mbuf_off/">os_mbuf_off</a>
+ <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
</li>
@@ -404,7 +412,7 @@
<li>
- <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
+ <a href="../os_mbuf_get/">os_mbuf_get</a>
</li>
@@ -412,7 +420,7 @@
<li>
- <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
+ <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
</li>
@@ -420,7 +428,15 @@
<li>
- <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
+ <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ </li>
+
+
+
+
+
+ <li>
+ <a href="../os_mbuf_off/">os_mbuf_off</a>
</li>
@@ -428,7 +444,7 @@
<li>
- <a href="../os_mqueue_get/">os_mqueue_get</a>
+ <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
</li>
@@ -436,7 +452,7 @@
<li>
- <a href="../os_mqueue_init/">os_mqueue_init</a>
+ <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
</li>
@@ -444,7 +460,7 @@
<li>
- <a href="../os_mqueue_put/">os_mqueue_put</a>
+ <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
</li>
@@ -494,6 +510,15 @@
<li><a href="
+ ../../mqueue/mqueue/
+">MQueue</a>
+
+ </li>
+
+
+
+
+ <li><a href="
../../sanity/sanity/
">Sanity</a>
@@ -672,7 +697,7 @@
- <li>Functions »</li>
+ <li>Functions/Macros »</li>
@@ -684,7 +709,66 @@
<hr/>
</div>
-
+ <h2 id="os_mbuf_copydata"><font color="#F2853F" style="font-size:24pt"> os_mbuf_copydata</font><a class="headerlink" href="#os_mbuf_copydata" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">int os_mbuf_copydata(const struct os_mbuf *m, int off, int len, void *dst)
+</code></pre>
+
+<p>Copy data from an mbuf chain starting <em>off</em> bytes from the beginning, continuing for <em>len</em> bytes, into the indicated buffer.</p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<table>
+<thead>
+<tr>
+<th>Arguments</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>m</td>
+<td>Pointer to mbuf chain</td>
+</tr>
+<tr>
+<td>off</td>
+<td>Start copy offset, in bytes, from beginning of mbuf chain</td>
+</tr>
+<tr>
+<td>len</td>
+<td>Number of bytes to copy</td>
+</tr>
+<tr>
+<td>dst</td>
+<td>Data buffer to copy into</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>0: success.<br />
+-1: The mbuf does not contain enough data</p>
+<p><br></p>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight"> int rc;
+ struct os_mbuf *om;
+ struct my_hdr_1 my_hdr1;
+ struct my_hdr_2 my_hdr2;
+
+ /* Header 1 and Header 2 are contiguous in packet at start. Retrieve them from the mbuf chain */
+ rc = os_mbuf_copydata(om, 0, sizeof(struct my_hdr_1), &my_hdr1);
+ if (rc) {
+ /* error! */
+ return -1;
+ }
+
+ rc = os_mbuf_copydata(om, sizeof(struct my_hdr_1), sizeof(struct my_hdr_2), &my_hdr2);
+ if (rc) {
+ /* error! */
+ return -1;
+ }
+
+</code></pre>
+
+<hr />
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/370712c1/os/core_os/mbuf/os_mbuf_copyinto/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/mbuf/os_mbuf_copyinto/index.html b/os/core_os/mbuf/os_mbuf_copyinto/index.html
index 3d58130..4e87367 100644
--- a/os/core_os/mbuf/os_mbuf_copyinto/index.html
+++ b/os/core_os/mbuf/os_mbuf_copyinto/index.html
@@ -145,7 +145,7 @@
<li><a href="
- ../../../tutorials/project2/
+ ../../../tutorials/STM32F303/
">Tutorials</a>
</li>
@@ -276,15 +276,15 @@
<li><a href="
- ../_os_mbuf_copypkthdr/
-">Functions</a>
+ ../OS_MBUF_PKTHDR/
+">Functions/Macros</a>
<ul class="current-toc">
<li>
- <a href="../_os_mbuf_copypkthdr/">_os_mbuf_copypkthdr</a>
+ <a href="../OS_MBUF_PKTHDR/">OS_MBUF_PKTHDR</a>
</li>
@@ -292,7 +292,7 @@
<li>
- <a href="../_os_msys_find_pool/">_os_msys_find_pool.md</a>
+ <a href="../OS_MBUF_PKTHDR_TO_MBUF/">OS_MBUF_PKTHDR_TO_MBUF</a>
</li>
@@ -300,7 +300,7 @@
<li>
- <a href="../os_mbuf_adj/">os_mbuf_adj</a>
+ <a href="../OS_MBUF_PKTLEN/">OS_MBUF_PKTLEN</a>
</li>
@@ -308,7 +308,7 @@
<li>
- <a href="../os_mbuf_append/">os_mbuf_append</a>
+ <a href="../OS_MBUF_DATA/">OS_MBUF_DATA</a>
</li>
@@ -316,7 +316,7 @@
<li>
- <a href="../os_mbuf_concat/">os_mbuf_concat</a>
+ <a href="../OS_MBUF_USRHDR/">OS_MBUF_USRHDR</a>
</li>
@@ -324,15 +324,15 @@
<li>
- <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
+ <a href="../OS_MBUF_USRHDR_LEN/">OS_MBUF_USRHDR_LEN</a>
</li>
- <li class="active">
- os_mbuf_copyinto
+ <li>
+ <a href="../OS_MBUF_LEADINGSPACE/">OS_MBUF_LEADINGSPACE</a>
</li>
@@ -340,7 +340,7 @@
<li>
- <a href="../os_mbuf_dup/">os_mbuf_dup</a>
+ <a href="../OS_MBUF_TRAILINGSPACE/">OS_MBUF_TRAILINGSPACE</a>
</li>
@@ -348,7 +348,7 @@
<li>
- <a href="../os_mbuf_extend/">os_mbuf_extend</a>
+ <a href="../os_mbuf_adj/">os_mbuf_adj</a>
</li>
@@ -356,7 +356,7 @@
<li>
- <a href="../os_mbuf_free/">os_mbuf_free</a>
+ <a href="../os_mbuf_append/">os_mbuf_append</a>
</li>
@@ -364,7 +364,7 @@
<li>
- <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
+ <a href="../os_mbuf_concat/">os_mbuf_concat</a>
</li>
@@ -372,7 +372,15 @@
<li>
- <a href="../os_mbuf_get/">os_mbuf_get</a>
+ <a href="../os_mbuf_copydata/">os_mbuf_copydata</a>
+ </li>
+
+
+
+
+
+ <li class="active">
+ os_mbuf_copyinto
</li>
@@ -380,7 +388,7 @@
<li>
- <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
+ <a href="../os_mbuf_dup/">os_mbuf_dup</a>
</li>
@@ -388,7 +396,7 @@
<li>
- <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ <a href="../os_mbuf_extend/">os_mbuf_extend</a>
</li>
@@ -396,7 +404,7 @@
<li>
- <a href="../os_mbuf_off/">os_mbuf_off</a>
+ <a href="../os_mbuf_free_chain/">os_mbuf_free_chain</a>
</li>
@@ -404,7 +412,7 @@
<li>
- <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
+ <a href="../os_mbuf_get/">os_mbuf_get</a>
</li>
@@ -412,7 +420,7 @@
<li>
- <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
+ <a href="../os_mbuf_get_pkthdr/">os_mbuf_get_pkthdr</a>
</li>
@@ -420,7 +428,15 @@
<li>
- <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
+ <a href="../os_mbuf_memcmp/">os_mbuf_memcmp</a>
+ </li>
+
+
+
+
+
+ <li>
+ <a href="../os_mbuf_off/">os_mbuf_off</a>
</li>
@@ -428,7 +444,7 @@
<li>
- <a href="../os_mqueue_get/">os_mqueue_get</a>
+ <a href="../os_mbuf_pool_init/">os_mbuf_pool_init</a>
</li>
@@ -436,7 +452,7 @@
<li>
- <a href="../os_mqueue_init/">os_mqueue_init</a>
+ <a href="../os_mbuf_prepend/">os_mbuf_prepend</a>
</li>
@@ -444,7 +460,7 @@
<li>
- <a href="../os_mqueue_put/">os_mqueue_put</a>
+ <a href="../os_mbuf_pullup/">os_mbuf_pullup</a>
</li>
@@ -494,6 +510,15 @@
<li><a href="
+ ../../mqueue/mqueue/
+">MQueue</a>
+
+ </li>
+
+
+
+
+ <li><a href="
../../sanity/sanity/
">Sanity</a>
@@ -672,7 +697,7 @@
- <li>Functions »</li>
+ <li>Functions/Macros »</li>
@@ -684,7 +709,66 @@
<hr/>
</div>
-
+ <h2 id="os_mbuf_copyinto"><font color="#F2853F" style="font-size:24pt"> os_mbuf_copyinto</font><a class="headerlink" href="#os_mbuf_copyinto" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">int os_mbuf_copyinto(struct os_mbuf *om, int off, const void *src, int len);
+</code></pre>
+
+<p>Copies the contents of a flat buffer into an mbuf chain, starting at the specified destination offset. If the mbuf is too small for the source data, it is extended as necessary. If the destination mbuf contains a packet header, the header length is updated.</p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<table>
+<thead>
+<tr>
+<th>Arguments</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>om</td>
+<td>Pointer to mbuf chain</td>
+</tr>
+<tr>
+<td>off</td>
+<td>Start copy offset, in bytes, from beginning of mbuf chain</td>
+</tr>
+<tr>
+<td>src</td>
+<td>Address from which bytes are copied</td>
+</tr>
+<tr>
+<td>len</td>
+<td>Number of bytes to copy from src</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>0: success.<br />
+All other values indicate an error.</p>
+<p><br></p>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight"> int rc;
+ uint16_t pktlen;
+ struct os_mbuf *om;
+ struct my_data_struct my_data;
+
+ /* Get initial packet length */
+ pktlen = OS_MBUF_PKTLEN(om);
+
+ /* Copy "my_data" into mbuf */
+ rc = os_mbuf_copyinto(om, 0, &my_data, sizeof(struct my_data_struct));
+ if (rc) {
+ os_mbuf_free_chain(om);
+ return;
+ }
+
+ /* Packet length should have increased by size of "my_data" */
+ pktlen += sizeof(struct my_data_struct);
+ assert(pktlen == OS_MBUF_PKTLEN(om));
+</code></pre>
+
+<hr />
</div>
</div>