C, Linux

[libressl] Setup

SETUP Install the dependencies first

  Clone the repository from Github

  Prepare the source tree

  Configure the source tree and compile the libressl

  Install the libressl under ${HOME}/opt/libressl

  The following error will arise if the library is not written to linked library config file

  To avoid the above error

Continue Reading

Algorithms, C++

Breadth first search

Steps: Add root to queue If left child not null, add it to queue If right child not null, add it to queue Repeat 2 & 3 until the queue is empty

 

C, C++, Language

CMake command

Set variable Basic usage of SET

  To include existing variables in the SET

  To include multiple items in SET

  Include include path (header)   Suppose we have the header files like this

  To globally add the include path, use include_directories

  To specially add the include path for target, use target_include_directories

Continue Reading

C++

Google C++ style guide

Filenames should be all lowercase with underscores (_) or dashes (-) hello_world.cc   All types like classes, structs, type aliases, enums, and type should be capitalized. class Person   Variables should be all lowercase with underscores string table_name   Data member in the class (not struct) should contain a trailing underscores string var_in_class_   Use a struct only for passive objects that carry…

Continue Reading

C++

C++ 11

Auto type

  Auto type + Ranged-based for loop

  Initializer list

  Strongly-typed enum

  Compile time assert

 

Gatekeeper

[Method]alloc_and_fill_notify_pkt

Depending on the ethertype, by using rte_pktmbuf_append, the following component will be packed into the packet accordingly.   static inline char *rte_pktmbuf_append(struct rte_mbuf *m, uint16_t len) It takes the memory buffer and the its length. It returns the pointer to tail after the insertion of data.   notify_pkt is composed by: link layer header ipv4/ipv6 header udp header ggu_common header