ipq_create_handle.3 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. .TH IPQ_CREATE_HANDLE 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual"
  2. .\"
  3. .\" Copyright (c) 2000-2001 Netfilter Core Team
  4. .\"
  5. .\" This program is free software; you can redistribute it and/or modify
  6. .\" it under the terms of the GNU General Public License as published by
  7. .\" the Free Software Foundation; either version 2 of the License, or
  8. .\" (at your option) any later version.
  9. .\"
  10. .\" This program is distributed in the hope that it will be useful,
  11. .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. .\" GNU General Public License for more details.
  14. .\"
  15. .\" You should have received a copy of the GNU General Public License
  16. .\" along with this program; if not, write to the Free Software
  17. .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. .\"
  19. .\"
  20. .SH NAME
  21. ipq_create_handle, ipq_destroy_handle \(em create and destroy libipq handles.
  22. .SH SYNOPSIS
  23. .B #include <linux/netfilter.h>
  24. .br
  25. .B #include <libipq.h>
  26. .sp
  27. .BI "struct ipq_handle *ipq_create_handle(u_int32_t " flags ", u_int32_t " protocol ");"
  28. .br
  29. .BI "int ipq_destroy_handle(struct ipq_handle *" h );
  30. .SH DESCRIPTION
  31. The
  32. .B ipq_create_handle
  33. function initialises libipq for an application, attempts to bind to the
  34. Netlink socket used by ip_queue, and returns an opaque context handle. It
  35. should be the first libipq function to be called by an application. The
  36. handle returned should be used in all subsequent library calls which
  37. require a handle parameter.
  38. .PP
  39. The
  40. .I flags
  41. parameter is not currently used and should be set to zero by the application
  42. for forward compatibility.
  43. .PP
  44. The
  45. .I protocol
  46. parameter is used to specify the protocol of the packets to be queued.
  47. Valid values are NFPROTO_IPV4 for IPv4 and NFPROTO_IPV6 for IPv6. Currently,
  48. only one protocol may be queued at a time for a handle.
  49. .PP
  50. The
  51. .B ipq_destroy_handle
  52. function frees up resources allocated by
  53. .BR ipq_create_handle ,
  54. and should be used when the handle is no longer required by the application.
  55. .SH RETURN VALUES
  56. On success,
  57. .B ipq_create_handle
  58. returns a pointer to a context handle.
  59. .br
  60. On failure, NULL is returned.
  61. .PP
  62. On success,
  63. .B ipq_destroy_handle
  64. returns zero.
  65. .br
  66. On failure, \-1 is returned.
  67. .SH ERRORS
  68. On failure, a descriptive error message will be available
  69. via the
  70. .B ipq_errstr
  71. function.
  72. .SH BUGS
  73. None known.
  74. .SH AUTHOR
  75. James Morris <jmorris@intercode.com.au>
  76. .SH COPYRIGHT
  77. Copyright (c) 2000-2001 Netfilter Core Team.
  78. .PP
  79. Distributed under the GNU General Public License.
  80. .SH SEE ALSO
  81. .BR iptables (8),
  82. .BR libipq (3).