135-sync-iptables-header.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Description: Sync header from iptables
  2. The current versions in several suites have the same content:
  3. - 1.6.1-2 (unstable)
  4. Bug: https://bugs.debian.org/868059
  5. Forwarded: not-needed
  6. Author: Cyril Brulebois <[email protected]>
  7. Last-Update: 2017-11-22
  8. --- a/include/xtables.h
  9. +++ b/include/xtables.h
  10. @@ -205,9 +205,24 @@ enum xtables_ext_flags {
  11. XTABLES_EXT_ALIAS = 1 << 0,
  12. };
  13. +struct xt_xlate;
  14. +
  15. +struct xt_xlate_mt_params {
  16. + const void *ip;
  17. + const struct xt_entry_match *match;
  18. + int numeric;
  19. + bool escape_quotes;
  20. +};
  21. +
  22. +struct xt_xlate_tg_params {
  23. + const void *ip;
  24. + const struct xt_entry_target *target;
  25. + int numeric;
  26. + bool escape_quotes;
  27. +};
  28. +
  29. /* Include file for additions: new matches and targets. */
  30. -struct xtables_match
  31. -{
  32. +struct xtables_match {
  33. /*
  34. * ABI/API version this module requires. Must be first member,
  35. * as the rest of this struct may be subject to ABI changes.
  36. @@ -269,6 +284,10 @@ struct xtables_match
  37. void (*x6_fcheck)(struct xt_fcheck_call *);
  38. const struct xt_option_entry *x6_options;
  39. + /* Translate iptables to nft */
  40. + int (*xlate)(struct xt_xlate *xl,
  41. + const struct xt_xlate_mt_params *params);
  42. +
  43. /* Size of per-extension instance extra "global" scratch space */
  44. size_t udata_size;
  45. @@ -280,8 +299,7 @@ struct xtables_match
  46. unsigned int loaded; /* simulate loading so options are merged properly */
  47. };
  48. -struct xtables_target
  49. -{
  50. +struct xtables_target {
  51. /*
  52. * ABI/API version this module requires. Must be first member,
  53. * as the rest of this struct may be subject to ABI changes.
  54. @@ -346,6 +364,10 @@ struct xtables_target
  55. void (*x6_fcheck)(struct xt_fcheck_call *);
  56. const struct xt_option_entry *x6_options;
  57. + /* Translate iptables to nft */
  58. + int (*xlate)(struct xt_xlate *xl,
  59. + const struct xt_xlate_tg_params *params);
  60. +
  61. size_t udata_size;
  62. /* Ignore these men behind the curtain: */
  63. @@ -406,6 +428,17 @@ struct xtables_globals
  64. #define XT_GETOPT_TABLEEND {.name = NULL, .has_arg = false}
  65. +/*
  66. + * enum op-
  67. + *
  68. + * For writing clean nftables translations code
  69. + */
  70. +enum xt_op {
  71. + XT_OP_EQ,
  72. + XT_OP_NEQ,
  73. + XT_OP_MAX,
  74. +};
  75. +
  76. #ifdef __cplusplus
  77. extern "C" {
  78. #endif
  79. @@ -548,6 +581,14 @@ extern void xtables_lmap_free(struct xta
  80. extern int xtables_lmap_name2id(const struct xtables_lmap *, const char *);
  81. extern const char *xtables_lmap_id2name(const struct xtables_lmap *, int);
  82. +/* xlate infrastructure */
  83. +struct xt_xlate *xt_xlate_alloc(int size);
  84. +void xt_xlate_free(struct xt_xlate *xl);
  85. +void xt_xlate_add(struct xt_xlate *xl, const char *fmt, ...);
  86. +void xt_xlate_add_comment(struct xt_xlate *xl, const char *comment);
  87. +const char *xt_xlate_get_comment(struct xt_xlate *xl);
  88. +const char *xt_xlate_get(struct xt_xlate *xl);
  89. +
  90. #ifdef XTABLES_INTERNAL
  91. /* Shipped modules rely on this... */