summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-07-31 17:57:58 +0200
committerDave Wallace <dwallacelf@gmail.com>2019-10-09 13:18:47 +0000
commit66f2a8891f4c0fd49433280be06e5e007491e044 (patch)
tree2e3364ae1c874f76a659f4d0b0cf6f4638613234 /docs
parent7b2e9fb1a8f389fa7b88fcbaf3356cbdae254250 (diff)
docs: Add macos build documentation
Type: docs Change-Id: Iee03aacab2cfcb4e87190302dc641e8273b7f096 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/gettingstarted/developers/cross_compile_macos.rst57
-rw-r--r--docs/gettingstarted/developers/index.rst1
2 files changed, 58 insertions, 0 deletions
diff --git a/docs/gettingstarted/developers/cross_compile_macos.rst b/docs/gettingstarted/developers/cross_compile_macos.rst
new file mode 100644
index 00000000000..932f86549f6
--- /dev/null
+++ b/docs/gettingstarted/developers/cross_compile_macos.rst
@@ -0,0 +1,57 @@
+.. _cross_compile_macos :
+
+Cross compilation on MacOS
+==========================
+
+This is a first attempt to support Cross compilation of VPP on MacOS for development (linting, completion, compile_commands.json)
+
+
+**Prerequisites**
+
+* You'll need to install the following packages
+
+.. code-block:: bash
+
+ pip3 install ply
+ brew install diffutils gnu-sed pkg-config ninja crosstool-ng
+
+* You'll also need to install ``gnu-ident 2.2.11`` to be able to ``make checkstyle``. You can get it from `GNU <https://www.gnu.org/prep/ftp.html>`_
+* You should link the binaries to make them available in your path with their original names e.g. :
+
+.. code-block:: bash
+
+ ln -s $(which gsed) /usr/local/bin/sed
+ ln -s $(which gindent) /usr/local/bin/indent
+ ln -s /usr/local/Cellar/diffutils/3.7/bin/diff /usr/local/bin/diff
+
+
+**Setup**
+
+* Create a `cross compile toolchain <https://crosstool-ng.github.io/>`_
+* Create a case sensitive volume and mount the toolchain in it e.g. in ``/Volumes/xchain``
+* Create a xchain.toolchain file with ``$VPP_DIR/extras/scripts/cross_compile_macos.sh conf /Volumes/xchan``
+
+For now we don't support e-build so dpdk, rdma, quicly won't be compiled as part of ``make build``
+
+To build with the toolchain do:
+
+.. code-block:: bash
+
+ $VPP_DIR/extras/scripts/cross_compile_macos.sh build
+
+
+To get the compile_commands.json do
+
+.. code-block:: bash
+
+ $VPP_DIR/extras/scripts/cross_compile_macos.sh cc
+ # >> ./build-root/build-vpp[_debug]-native/vpp/compile_commands.json
+
+
+
+This should build vpp on MacOS
+
+
+Good luck :)
+
+
diff --git a/docs/gettingstarted/developers/index.rst b/docs/gettingstarted/developers/index.rst
index 2d27da99ba8..93f4e33ee7f 100644
--- a/docs/gettingstarted/developers/index.rst
+++ b/docs/gettingstarted/developers/index.rst
@@ -40,3 +40,4 @@ The Developers section covers the following areas:
buildwireshark
punt
quic_plugin
+ cross_compile_macos.rst
.py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2017-2019 Cisco and/or its affiliates.
 * 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 connectionTable_h
#define connectionTable_h

#include <src/core/connection.h>
#include <src/core/connectionList.h>
#include <src/io/addressPair.h>
#include <src/io/ioOperations.h>

struct connection_table;
typedef struct connection_table ConnectionTable;

/**
 * Creates an empty connection table
 */
ConnectionTable *connectionTable_Create(void);

/**
 * Destroys the connection table
 * This will release the reference to all connections stored in the connection
 * table.
 * @param [in,out] conntablePtr Pointer to the allocated connection table, will
 * be NULL'd
 */
void connectionTable_Destroy(ConnectionTable **conntablePtr);

/**
 * @function connectionTable_Add
 * @abstract Add a connection, takes ownership of memory
 */
void connectionTable_Add(ConnectionTable *table, Connection *connection);

/**
 * @function connectionTable_Remove
 * @abstract Removes the connection, calling Destroy on our copy
 */
void connectionTable_Remove(ConnectionTable *table,
                            const Connection *connection);

/**
 * Removes a connection from the connection table
 *
 * Looks up a connection by its connection ID and removes it from the connection
 * table. Removing the connection will call connection_Release() on the
 * connection object.
 *
 * @param [in] table The allocated connection table
 * @param [in] id The connection ID
 */
void connectionTable_RemoveById(ConnectionTable *table, unsigned id);

/**
 * Lookup a connection by the (local, remote) addres pair
 *
 * @param [in] table The allocated connection table
 * @param [in] pair The address pair to match, based on the inner values of the
 * local and remote addresses
 *
 * @retval non-null The matched conneciton
 * @retval null No match found or error
 */
const Connection *connectionTable_FindByAddressPair(ConnectionTable *table,
                                                    const AddressPair *pair);

/**
 * @function connectionTable_FindById
 * @abstract Find a connection by its numeric id.
 * @return NULL if not found
 */
const Connection *connectionTable_FindById(ConnectionTable *table, unsigned id);

/**
 * @function connectionTable_GetEntries
 * @abstract Returns a list of connections.  They are reference counted copies
 * from the table.
 * @discussion
 *   An allocated list of connections in the table.  Each list entry is a
 * reference counted copy of the connection in the table, thus they are "live"
 * objects.
 */
ConnectionList *connectionTable_GetEntries(const ConnectionTable *table);
#endif  // connectionTable_h