You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
4.2 KiB

  1. --- a/src/server/knxd_args.cpp
  2. +++ b/src/server/knxd_args.cpp
  3. @@ -68,13 +68,13 @@ struct L2options
  4. } while(0)
  5. IniData ini;
  6. -char link[99] = "@.";
  7. +char link2[99] = "@.";
  8. void link_to(const char *arg)
  9. {
  10. char *p;
  11. - ++*link;
  12. - strcpy(link+2,arg);
  13. - p = strchr(link+2,':');
  14. + ++*link2;
  15. + strcpy(link2+2,arg);
  16. + p = strchr(link2+2,':');
  17. if (p)
  18. *p = 0;
  19. }
  20. @@ -163,10 +163,10 @@ public:
  21. {
  22. link_to(name);
  23. ITER(i, more_args)
  24. - (*ini[link])[i->first] = i->second;
  25. - (*ini[link])["filter"] = name;
  26. + (*ini[link2])[i->first] = i->second;
  27. + (*ini[link2])["filter"] = name;
  28. more_args.clear();
  29. - filters.push_back(link);
  30. + filters.push_back(link2);
  31. }
  32. else
  33. filters.push_back(name);
  34. @@ -232,7 +232,7 @@ void driver_argsv(const char *arg, char
  35. {
  36. va_list apl;
  37. va_start(apl, ap);
  38. - (*ini[link])["driver"] = arg;
  39. + (*ini[link2])["driver"] = arg;
  40. char *pa = NULL;
  41. while(ap)
  42. @@ -250,7 +250,7 @@ void driver_argsv(const char *arg, char
  43. if (*pa == '!') // required-argument flag
  44. pa++;
  45. if (*ap) // skip empty arguments
  46. - (*ini[link])[pa] = ap;
  47. + (*ini[link2])[pa] = ap;
  48. ap = p2;
  49. }
  50. if (pa != NULL)
  51. @@ -280,7 +280,7 @@ void driver_args(const char *arg, char *
  52. else if(!strcmp(arg,"iptn"))
  53. {
  54. driver_argsv("ipt",ap, "!ip-address","dest-port","src-port","nat-ip","data-port", NULL);
  55. - (*ini[link])["nat"] = "true";
  56. + (*ini[link2])["nat"] = "true";
  57. }
  58. else if(!strcmp(arg,"ft12") || !strcmp(arg,"ncn5120") || !strcmp(arg,"tpuarts") || !strcmp(arg,"ft12cemi") || !strcmp(arg,"tpuart"))
  59. {
  60. @@ -556,18 +556,18 @@ parse_opt (int key, char *arg, struct ar
  61. if (arguments->want_server)
  62. die("You need -S after -D/-T/-R");
  63. link_to("unix");
  64. - ADD((*ini["main"])["connections"], link);
  65. - (*ini[link])["server"] = "knxd_unix";
  66. + ADD((*ini["main"])["connections"], link2);
  67. + (*ini[link2])["server"] = "knxd_unix";
  68. // (*ini[link])["driver"] = "knx-link";
  69. const char *name = OPT_ARG(arg,state,NULL);
  70. if (name)
  71. {
  72. - (*ini[link])["path"] = name;
  73. - (*ini[link])["systemd-ignore"] = "false";
  74. + (*ini[link2])["path"] = name;
  75. + (*ini[link2])["systemd-ignore"] = "false";
  76. }
  77. else
  78. - (*ini[link])["systemd-ignore"] = "true";
  79. - arguments->stack(link);
  80. + (*ini[link2])["systemd-ignore"] = "true";
  81. + arguments->stack(link2);
  82. }
  83. break;
  84. @@ -576,19 +576,19 @@ parse_opt (int key, char *arg, struct ar
  85. if (arguments->want_server)
  86. die("You need -S after -D/-T/-R");
  87. link_to("tcp");
  88. - ADD((*ini["main"])["connections"], link);
  89. - (*ini[link])["server"] = "knxd_tcp";
  90. + ADD((*ini["main"])["connections"], link2);
  91. + (*ini[link2])["server"] = "knxd_tcp";
  92. // (*ini[link])["driver"] = "knx-link";
  93. const char *port = OPT_ARG(arg,state,"");
  94. if (*port && atoi(port) > 0)
  95. {
  96. - (*ini[link])["port"] = port;
  97. - (*ini[link])["systemd-ignore"] = "false";
  98. + (*ini[link2])["port"] = port;
  99. + (*ini[link2])["systemd-ignore"] = "false";
  100. }
  101. else
  102. - (*ini[link])["systemd-ignore"] = "true";
  103. + (*ini[link2])["systemd-ignore"] = "true";
  104. - arguments->stack(link);
  105. + arguments->stack(link2);
  106. }
  107. break;
  108. @@ -635,8 +635,8 @@ parse_opt (int key, char *arg, struct ar
  109. die("You cannot apply flags to the group cache.");
  110. link_to("cache");
  111. - (*ini["main"])["cache"] = link;
  112. - arguments->stack(link);
  113. + (*ini["main"])["cache"] = link2;
  114. + arguments->stack(link2);
  115. break;
  116. case OPT_FORCE_BROADCAST:
  117. (*ini["main"])["force-broadcast"] = "true";
  118. @@ -675,12 +675,12 @@ parse_opt (int key, char *arg, struct ar
  119. if (arguments->want_server)
  120. die("You need -S after -D/-T/-R");
  121. link_to(arg);
  122. - ADD((*ini["main"])["connections"], link);
  123. + ADD((*ini["main"])["connections"], link2);
  124. char *ap = strchr(arg,':');
  125. if (ap)
  126. *ap++ = '\0';
  127. driver_args(arg,ap);
  128. - arguments->stack(link);
  129. + arguments->stack(link2);
  130. break;
  131. }
  132. case 'B':