Querying libiptc HOWTO
Prev Next

10. How to create your program(s)

Create your program(s) in /usr/local/src ; this way you will not have problems with gcc looking for files in the "include" section.

Your program(s) would be something like this:

/* My program */

#include <getopt.h>
#include <sys/errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
#include <time.h>
#include "libiptc/libiptc.h"
#include "iptables.h"

int main(void)
{

  /* Use always this part for your programs .... From here ... **** */

  iptc_handle_t h;
  const char *chain = NULL;
  const char *tablename = NULL;

  program_name = "my_program";
  program_version = NETFILTER_VERSION;

  /* .... To here .... ******************************************** */



  /* From here you write your own code */

  .... your code ...
  ....
  ....

} /* main */

  • The "include" section is a must in your c/c++ program(s).

  • If you are using c++ do not forget to write extern "C" for these include.


Prev Home Next
Installing iptables + libiptc   Functions to query libiptc


  • Bookmark
  • Add Resource
  • Modify Resource
  • Get Rated
  • Link to Us
  • Advertise
  • Contact
  • Search Resources

  • Recommended

    • Web Site Templates
    • Ultimate Trading Script
    • The Exterminator
    • Guestbook Script
    • Thumbnail Creator
    • Custom Programming
    • PHP Forums
    • Ajax Tutorial
  • Resource Map

    • Home
    • Expanded Directory
    • New Listings
    • Most Popular
    • Top Rated
    • Email Updates
    • Random Link
    • Advanced Search
    • Bookmark Us
    • Link to Us
    • Advertising Info
    • Webmaster Forum
    • Accessibility Statement
  • General Resources

    • ASP
    • C/C++
    • ColdFusion
    • Flash / ActionScript
    • General
    • HTML
    • Java
    • JavaScript
    • Perl
    • PHP
    • Python
    • Remotely Hosted
    • Unix Shell
    • Visual Basic
    • XML
  • Scripts & Programs

    • ASP
    • C/C++
    • ColdFusion
    • Flash / ActionScript
    • Java
    • JavaScript
    • Perl
    • PHP
    • Python
    • Remotely Hosted
    • Unix Shell
    • Visual Basic
    • XML
  • Online Tutorials

    • ASP
    • C/C++
    • ColdFusion
    • Flash / ActionScript
    • HTML
    • Howtos
    • Java
    • JavaScript
    • Perl
    • PHP
    • Python
    • Unix Shell
    • Visual Basic
    • XML
  • Books

    • ASP
    • C/C++
    • ColdFusion
    • Flash / ActionScript
    • HTML
    • Java
    • JavaScript
    • Perl
    • PHP
    • Python
    • Unix Shell
    • Visual Basic
    • XML
  • Supporters

    • Bigwebmaster Supporters
    • Ozzu Website Templates
    • Calendrier 2007
    • Debt Help
    • Loans
    • Loans
    • Debt Consolidation
  • Partners

    • Unmelted Templates
    • Web Design Forum