Home | History | Annotate | Download | only in ftp-proxy

Lines Matching defs:fpe

104 	struct ftp_proxy_entry *fpe;
107 fpe = malloc(sizeof(*fpe));
108 if (fpe == NULL)
111 fpe->id = id;
112 fpe->status = 0;
114 rv = snprintf(fpe->proxy_tag, sizeof(fpe->proxy_tag), "ftp_%d", id);
115 if (rv == -1 || rv >= sizeof(fpe->proxy_tag)) {
116 free(fpe);
120 LIST_INIT(&fpe->nat_entries);
121 LIST_INSERT_HEAD(&ftp_proxy_entries, fpe, link);
123 return (fpe);
127 ftp_proxy_entry_remove(struct ftp_proxy_entry *fpe)
131 while ((fpn = LIST_FIRST(&fpe->nat_entries)) != NULL) {
136 LIST_REMOVE(fpe, link);
137 free(fpe);
143 struct ftp_proxy_entry *fpe;
145 LIST_FOREACH(fpe, &ftp_proxy_entries, link) {
146 if (fpe->id == id) {
147 return fpe;
154 ftp_proxy_entry_add_nat(struct ftp_proxy_entry *fpe, ipnat_t *ipn)
163 LIST_INSERT_HEAD(&fpe->nat_entries, fpn, link);
226 struct ftp_proxy_entry *fpe = ftp_proxy_entry_find(id);
229 if (fpe == NULL) {
256 strlcpy(ipn->in_tag.ipt_tag, fpe->proxy_tag,
272 if (ftp_proxy_entry_add_nat(fpe, ipn) == -1) {
277 fpe->status = 1;
286 struct ftp_proxy_entry *fpe, *n;
289 for (fpe = LIST_FIRST(&ftp_proxy_entries); fpe != NULL; fpe = n) {
290 n = LIST_NEXT(fpe, link);
296 if (fpe->status == 0) {
297 while ((fpn = LIST_FIRST(&fpe->nat_entries)) != NULL) {
305 ftp_proxy_entry_remove(fpe);
332 struct ftp_proxy_entry *fpe;
334 fpe = ftp_proxy_entry_find(id);
335 if (fpe == NULL) {
336 fpe = ftp_proxy_entry_create(id);
337 if (fpe == NULL)
340 fpe->status = 0;