1"use strict";(globalThis.webpackChunkpcapplusplus_github_io=globalThis.webpackChunkpcapplusplus_github_io||[]).push([[5483],{2011(e,l,i){i.r(l),i.d(l,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>s,toc:()=>o});const s=JSON.parse('{"id":"install/freebsd","title":"Build on FreeBSD","description":"Prerequisites","source":"@site/versioned_docs/version-v22.05/install/freebsd.mdx","sourceDirName":"install","slug":"/install/freebsd","permalink":"/docs/v22.05/install/freebsd","draft":false,"unlisted":false,"editUrl":"https://github.com/PcapPlusPlus/pcapplusplus.github.io/edit/master/versioned_docs/version-v22.05/install/freebsd.mdx","tags":[],"version":"v22.05","frontMatter":{"title":"Build on FreeBSD"},"sidebar":"docs","previous":{"title":"Build for Android","permalink":"/docs/v22.05/install/android"},"next":{"title":"Feature Overview","permalink":"/docs/v22.05/features"}}');var n=i(4848),t=i(8453);const r={title:"Build on FreeBSD"},d="Build From Source on FreeBSD",c={},o=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Build the code",id:"build-the-code",level:2},{value:"Installation",id:"installation",level:2},{value:"Running tests",id:"running-tests",level:2}];function a(e){const l={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.header,{children:(0,n.jsx)(l.h1,{id:"build-from-source-on-freebsd",children:"Build From Source on FreeBSD"})}),"\n",(0,n.jsx)(l.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,n.jsx)(l.p,{children:"In order to compile PcapPlusPlus on FreeBSD please make sure you have the following components installed:"}),"\n",(0,n.jsxs)(l.ul,{children:["\n",(0,n.jsxs)(l.li,{children:[(0,n.jsx)(l.code,{children:"git"})," (if not installed please run: ",(0,n.jsx)(l.code,{children:"pkg install git"}),")"]}),"\n",(0,n.jsxs)(l.li,{children:[(0,n.jsx)(l.code,{children:"gsed"})," (if not installed please run: ",(0,n.jsx)(l.code,{children:"pkg install gsed"}),")"]}),"\n",(0,n.jsxs)(l.li,{children:[(0,n.jsx)(l.code,{children:"gmake"})," (if not installed please run: ",(0,n.jsx)(l.code,{children:"pkg install gmake"}),")"]}),"\n",(0,n.jsxs)(l.li,{children:[(0,n.jsx)(l.code,{children:"libpcap"})," (if not installed please run: ",(0,n.jsx)(l.code,{children:"pkg install libpcap"}),")"]}),"\n"]}),"\n",(0,n.jsx)(l.h2,{id:"configuration",children:"Configuration"}),"\n",(0,n.jsx)(l.p,{children:"Run the configuration script from PcapPlusPlus main directory:"}),"\n",(0,n.jsx)(l.pre,{children:(0,n.jsx)(l.code,{className:"language-bash",children:"./configure-freebsd.sh\n"})}),"\n",(0,n.jsxs)(l.p,{children:["This script has the following command-line switches (you can also view then by running ",(0,n.jsx)(l.code,{children:"./configure-freebsd.sh --help"})," or ",(0,n.jsx)(l.code,{children:"./configure-freebsd.sh -h"}),"):"]}),"\n",(0,n.jsxs)(l.table,{children:[(0,n.jsx)(l.thead,{children:(0,n.jsxs)(l.tr,{children:[(0,n.jsx)(l.th,{style:{textAlign:"left"},children:"Option"}),(0,n.jsx)(l.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,n.jsxs)(l.tbody,{children:[(0,n.jsxs)(l.tr,{children:[(0,n.jsx)(l.td,{style:{textAlign:"left"},children:(0,n.jsx)(l.strong,{children:"no switches"})}),(0,n.jsx)(l.td,{style:{textAlign:"left"},children:"use the default configuration"})]}),(0,n.jsxs)(l.tr,{children:[(0,n.jsx)(l.td,{style:{textAlign:"left"},children:(0,n.jsx)(l.strong,{children:(0,n.jsx)(l.code,{children:"--use-immediate-mode"})})}),(0,n.jsx)(l.td,{style:{textAlign:"left"},children:"use libpcap immediate mode which enables getting packets as fast as possible (supported on libpcap>=1.5)"})]}),(0,n.jsxs)(l.tr,{children:[(0,n.jsx)(l.td,{style:{textAlign:"left"},children:(0,n.jsx)(l.strong,{children:(0,n.jsx)(l.code,{children:"--set-direction-enabled"})})}),(0,n.jsx)(l.td,{style:{textAlign:"left"},children:"set direction for capturing incoming or outgoing packets (supported on libpcap>=0.9.1)"})]}),(0,n.jsxs)(l.tr,{children:[(0,n.jsx)(l.td,{style:{textAlign:"left"},children:(0,n.jsx)(l.strong,{children:(0,n.jsx)(l.code,{children:"--install-dir"})})}),(0,n.jsxs)(l.td,{style:{textAlign:"left"},children:["set a custom installation directory. Default is ",(0,n.jsx)(l.code,{children:"/u
1sr/local"})]})]}),(0,n.jsxs)(l.tr,{children:[(0,n.jsx)(l.td,{style:{textAlign:"left"},children:(0,n.jsx)(l.strong,{children:(0,n.jsx)(l.code,{children:"--libpcap-include-dir"})})}),(0,n.jsx)(l.td,{style:{textAlign:"left"},children:"libpcap header files directory. This parameter is optional and if omitted PcapPlusPlus will look for the header files in the default include paths"})]}),(0,n.jsxs)(l.tr,{children:[(0,n.jsx)(l.td,{style:{textAlign:"left"},children:(0,n.jsx)(l.strong,{children:(0,n.jsx)(l.code,{children:"--libpcap-lib-dir"})})}),(0,n.jsx)(l.td,{style:{textAlign:"left"},children:"libpcap pre compiled lib directory. This parameter is optional and if omitted PcapPlusPlus will look for the lib file in the default lib paths"})]}),(0,n.jsxs)(l.tr,{children:[(0,n.jsxs)(l.td,{style:{textAlign:"left"},children:[(0,n.jsx)(l.strong,{children:(0,n.jsx)(l.code,{children:"-h"})}),", ",(0,n.jsx)(l.strong,{children:(0,n.jsx)(l.code,{children:"--help"})})]}),(0,n.jsx)(l.td,{style:{textAlign:"left"},children:"displays a help message and exits. No further actions are performed"})]})]})]}),"\n",(0,n.jsx)(l.p,{children:"Here are a few examples:"}),"\n",(0,n.jsx)(l.p,{children:"Default configuration:"}),"\n",(0,n.jsx)(l.pre,{children:(0,n.jsx)(l.code,{className:"language-shell",children:"./configure-freebsd.sh\n"})}),"\n",(0,n.jsx)(l.p,{children:"Configure PcapPlusPlus with libpcap's immediate mode:"}),"\n",(0,n.jsx)(l.pre,{children:(0,n.jsx)(l.code,{className:"language-shell",children:"./configure-freebsd.sh --use-immediate-mode\n"})}),"\n",(0,n.jsx)(l.p,{children:"Configure PcapPlusPlus with libpcap's set direction:"}),"\n",(0,n.jsx)(l.pre,{children:(0,n.jsx)(l.code,{className:"language-shell",children:"./configure-freebsd.sh --set-direction-enabled\n"})}),"\n",(0,n.jsx)(l.p,{children:"Provide non-standard paths for libpcap header and library files:"}),"\n",(0,n.jsx)(l.pre,{children:(0,n.jsx)(l.code,{className:"language-shell",children:"./configure-freebsd.sh --libpcap-include-dir /my-folder/my-libpcap/include --libpcap-lib-dir /my-folder/my-libpcap/lib\n"})}),"\n",(0,n.jsx)(l.p,{children:"Provide a custom installation directory:"}),"\n",(0,n.jsx)(l.pre,{children:(0,n.jsx)(l.code,{className:"language-shell",children:"./configure-freebsd.sh --install-dir /my-folder/my-install-dir\n"})}),"\n",(0,n.jsx)(l.h2,{id:"build-the-code",children:"Build the code"}),"\n",(0,n.jsx)(l.p,{children:"After running the config script, you're can safely build the code:"}),"\n",(0,n.jsxs)(l.ol,{children:["\n",(0,n.jsxs)(l.li,{children:["Run ",(0,n.jsx)(l.code,{children:"gmake"})," or ",(0,n.jsx)(l.code,{children:"gmake all"})," from PcapPlusPlus main directory"]}),"\n",(0,n.jsx)(l.li,{children:"This should compile all libraries, unit-tests and examples"}),"\n",(0,n.jsxs)(l.li,{children:["To build the libraries only (without the unit-tests and examples) run ",(0,n.jsx)(l.code,{children:"gmake libs"})," instead of ",(0,n.jsx)(l.code,{children:"gmake all"})]}),"\n",(0,n.jsxs)(l.li,{children:["After compilation you can find the libraries, examples, header files and helpful makefiles under the ",(0,n.jsx)(l.code,{children:"Dist"})," directory"]}),"\n"]}),"\n",(0,n.jsx)(l.h2,{id:"installation",children:"Installation"}),"\n",(0,n.jsx)(l.p,{children:"After build is complete you can run the installation script which will copy the library and header files to the installation directory:"}),"\n",(0,n.jsx)(l.pre,{children:(0,n.jsx)(l.code,{className:"language-shell",children:"sudo gmake install\n"})}),"\n",(0,n.jsxs)(l.p,{children:["The default installation directory is ",(0,n.jsx)(l.code,{children:"/usr/local"})," which means the header files will be copied to ",(0,n.jsx)(l.code,{children:"/usr/local/include/pcapplusplus"})," and the library files will be copied to ",(0,n.jsx)(l.code,{children:"/usr/local/lib"}),"."]}),"\n",(0,n.jsxs)(l.p,{children:["You can change the installation directory by using the ",(0,n.jsx)(l.strong,{children:(0,n.jsx)(l.code,{children:"--install-dir"})})," switch in the configuration script."]}),"\n",(0,n.jsx)(l.h2,{id:"running-tests",children:"Running tests"}),"\n",(0,n.jsxs)(l.p,{children:["PcapPlusPlus contains a set of test-cases you can run to make sure that everything works correctly on your system. ",(0,n.jsx)(l.a,{href:"../tests",children:"This guide"})," contains detailed instructions on how to run them."]})]})}function h(e={}){const{wrapper:l}={...(0,t.R)(),...e.components};return l?(0,n.jsx)(l,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},8453(e,l,i){i.d(l,{R:()=>r,x:()=>d});var s=i(6540);const n={},t=s.createContext(n);function r(e){const l=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(l):{...l,...e}}),[l,e])}function d(e){let l;return l=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:r(e.components),s.createElement(t.Provider,{value:l},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.