• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asus-wl-520gu-7.0.1.45/src/router/shared.asus/

Lines Matching refs:app

56 valid_autofw_port(const netconf_app_t *app)
59 if (app->match.ipproto != IPPROTO_TCP && app->match.ipproto != IPPROTO_UDP)
63 if (ntohs(app->match.dst.ports[0]) > ntohs(app->match.dst.ports[1]))
67 if (app->proto != IPPROTO_TCP && app->proto != IPPROTO_UDP)
71 if (ntohs(app->dport[0]) > ntohs(app->dport[1]))
75 if (ntohs(app->to[0]) > ntohs(app->to[1]))
79 if ((ntohs(app->dport[1]) - ntohs(app->dport[0])) !=
80 (ntohs(app->to[1]) - ntohs(app->to[0])))
87 get_autofw_port(int which, netconf_app_t *app)
93 memset(app, 0, sizeof(netconf_app_t));
155 app->match.ipproto = IPPROTO_TCP;
157 app->match.ipproto = IPPROTO_UDP;
162 app->match.dst.ports[0] = htons(atoi(out_start));
163 app->match.dst.ports[1] = htons(atoi(out_end));
167 app->proto = IPPROTO_TCP;
169 app->proto = IPPROTO_UDP;
174 app->dport[0] = htons(atoi(in_start));
175 app->dport[1] = htons(atoi(in_end));
178 app->to[0] = htons(atoi(to_start));
179 app->to[1] = htons(atoi(to_end));
183 app->match.flags = NETCONF_DISABLED;
187 strncpy(app->desc, desc, sizeof(app->desc));
190 strncpy(app->match.in.name, nvram_safe_get("lan_ifname"), IFNAMSIZ);
193 app->match.src.ports[1] = htons(0xffff);
196 app->target = NETCONF_APP;
198 return valid_autofw_port(app);
202 set_autofw_port(int which, const netconf_app_t *app)
207 if (!valid_autofw_port(app))
215 if (app->match.ipproto == IPPROTO_TCP)
217 else if (app->match.ipproto == IPPROTO_UDP)
222 cur = safe_snprintf(cur, &len, "%d", ntohs(app->match.dst.ports[0]));
224 cur = safe_snprintf(cur, &len, "%d", ntohs(app->match.dst.ports[1]));
228 if (app->proto == IPPROTO_TCP)
230 else if (app->proto == IPPROTO_UDP)
235 cur = safe_snprintf(cur, &len, "%d", ntohs(app->dport[0]));
237 cur = safe_snprintf(cur, &len, "%d", ntohs(app->dport[1]));
241 cur = safe_snprintf(cur, &len, "%d", ntohs(app->to[0]));
243 cur = safe_snprintf(cur, &len, "%d", ntohs(app->to[1]));
247 if (app->match.flags & NETCONF_DISABLED)
253 if (*app->desc) {
255 cur = safe_snprintf(cur, &len, app->desc);
1062 netconf_app_t app;
1068 memset(&app, 0, sizeof(netconf_app_t));
1133 app.match.ipproto = IPPROTO_TCP;
1135 app.match.ipproto = IPPROTO_UDP;
1140 app.match.dst.ports[0] = htons(atoi(out_start));
1141 app.match.dst.ports[1] = htons(atoi(out_end));
1145 app.proto = IPPROTO_TCP;
1147 app.proto = IPPROTO_UDP;
1152 app.dport[0] = htons(atoi(in_start));
1153 app.dport[1] = htons(atoi(in_end));
1156 app.to[0] = htons(atoi(to_start));
1157 app.to[1] = htons(atoi(to_end));
1161 app.match.flags = NETCONF_DISABLED;
1165 strncpy(app.desc, desc, sizeof(app.desc));
1168 strncpy(app.match.in.name, nvram_safe_get("lan_ifname"), IFNAMSIZ);
1171 app.match.src.ports[1] = htons(0xffff);
1174 app.target = NETCONF_APP;
1177 valid = set_autofw_port(i, &app);