Book Image

iOS and OS X Network Programming Cookbook

By : Jon Hoffman
Book Image

iOS and OS X Network Programming Cookbook

By: Jon Hoffman

Overview of this book

Table of Contents (15 chapters)
iOS and OS X Network Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding libpcap to your project


The first thing that we need to do is add libpcap to our project. Whenever there is a project that you need to add libpcap to, you need to follow the steps mentioned here.

Getting ready

We need to create an OS X project that we can add the libpcap library to.

How to do it…

Once the project is created, we need to add the library to our project using these steps:

  1. Select the project name from the project navigator area within your Xcode project.

  2. Select the project name from the TARGET section.

  3. Select the Build Phases tab and open the Link Binary With Libraries section.

  4. Click on the + sign.

  5. Type libpcap in the search box and select the libpcap.dylib library.

Now that we have the library linked to the project, we need to set the application to run as root for debugging. To do so, follow these steps:

  1. To run your project as root, navigate to Product | Scheme | Edit Scheme from the top menu as shown in the following screenshot:

  2. In the window that opens up, change the Debug Process...