Lines Matching defs:ftp

234 	ftpinfo_t *ftp;
237 KMALLOC(ftp, ftpinfo_t *);
238 if (ftp == NULL)
243 aps->aps_data = ftp;
248 bzero((char *)ftp, sizeof(*ftp));
249 f = &ftp->ftp_side[0];
252 f = &ftp->ftp_side[1];
255 ftp->ftp_passok = FTPXY_INIT;
256 ftp->ftp_incok = 0;
262 ipf_p_ftp_setpending(ipf_main_softc_t *softc, ftpinfo_t *ftp)
264 if (ftp->ftp_pendnat != NULL)
265 ipf_nat_setpending(softc, ftp->ftp_pendnat);
267 if (ftp->ftp_pendstate != NULL) {
269 ipf_state_setpending(softc, ftp->ftp_pendstate);
280 ftpinfo_t *ftp;
282 ftp = aps->aps_data;
283 if (ftp != NULL)
284 ipf_p_ftp_setpending(softc, ftp);
289 ipf_p_ftp_port(softf, fin, ip, nat, ftp, dlen)
294 ftpinfo_t *ftp;
307 f = &ftp->ftp_side[0];
447 return ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, sp, inc);
452 ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, nport, inc)
457 ftpinfo_t *ftp;
473 if ((ftp->ftp_pendnat != NULL) || (ftp->ftp_pendstate != NULL)) {
476 ftpinfo_t *, ftp);
479 ftp->ftp_pendnat, ftp->ftp_pendstate);
482 ipf_p_ftp_setpending(softc, ftp);
495 DT3(ftp_PORT_error_port, nat_t *, nat, ftpinfo_t *, ftp,
587 nat2 = ipf_nat6_add(&fi, ipn, &ftp->ftp_pendnat, flags,
591 nat2 = ipf_nat_add(&fi, ipn, &ftp->ftp_pendnat, flags,
608 if (ipf_state_add(softc, &fi, (ipstate_t **)&ftp->ftp_pendstate,
617 ipf_p_ftp_client(softf, fin, ip, nat, ftp, dlen)
621 ftpinfo_t *ftp;
630 f = &ftp->ftp_side[0];
644 ftp->ftp_incok = 0;
645 DT2(ftp_client_command, char [], cmd, int, ftp->ftp_passok);
647 if (ftp->ftp_passok == FTPXY_ADOK_1 ||
648 ftp->ftp_passok == FTPXY_AUOK_1) {
649 ftp->ftp_passok = FTPXY_USER_2;
650 ftp->ftp_incok = 1;
652 ftp->ftp_passok = FTPXY_USER_1;
653 ftp->ftp_incok = 1;
656 ftp->ftp_passok = FTPXY_AUTH_1;
657 ftp->ftp_incok = 1;
659 if (ftp->ftp_passok == FTPXY_USOK_1) {
660 ftp->ftp_passok = FTPXY_PASS_1;
661 ftp->ftp_incok = 1;
662 } else if (ftp->ftp_passok == FTPXY_USOK_2) {
663 ftp->ftp_passok = FTPXY_PASS_2;
664 ftp->ftp_incok = 1;
666 } else if ((ftp->ftp_passok == FTPXY_AUOK_1) &&
668 ftp->ftp_passok = FTPXY_ADAT_1;
669 ftp->ftp_incok = 1;
670 } else if ((ftp->ftp_passok == FTPXY_PAOK_1 ||
671 ftp->ftp_passok == FTPXY_PAOK_2) &&
673 ftp->ftp_passok = FTPXY_ACCT_1;
674 ftp->ftp_incok = 1;
675 } else if ((ftp->ftp_passok == FTPXY_GO) &&
678 inc = ipf_p_ftp_port(softf, fin, ip, nat, ftp, dlen);
679 } else if ((ftp->ftp_passok == FTPXY_GO) &&
682 inc = ipf_p_ftp_eprt(softf, fin, ip, nat, ftp, dlen);
686 inc = ipf_p_ftp_port(softf, fin, ip, nat, ftp, dlen);
690 cmd, ftp->ftp_passok, ftp->ftp_incok, inc);
692 DT2(ftp_client_passok, char *, cmd, int, ftp->ftp_passok);
701 ipf_p_ftp_pasv(softf, fin, ip, nat, ftp, dlen)
706 ftpinfo_t *ftp;
717 (ftp->ftp_side[0].ftps_cmd != FTPXY_C_PASV)) {
718 DT2(ftp_PASV_error_state, nat_t *, nat, ftpinfo_t *, ftp);
721 ftp->ftp_side[0].ftps_cmd);
725 f = &ftp->ftp_side[1];
732 DT3(ftp_PASV_error_short, nat_t *, nat, ftpinfo_t *, ftp,
740 DT2(ftp_PASV_error_string, nat_t *, nat, ftpinfo_t *, ftp);
846 return ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, (a5 << 8 | a6),
851 ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, port, newmsg, s)
856 ftpinfo_t *ftp;
878 if ((ftp->ftp_pendnat != NULL) || (ftp->ftp_pendstate != NULL))
879 ipf_p_ftp_setpending(softc, ftp);
888 f = &ftp->ftp_side[1];
934 nat2 = ipf_nat6_add(&fi, ipn, &ftp->ftp_pendnat,
938 nat2 = ipf_nat_add(&fi, ipn, &ftp->ftp_pendnat,
961 if (ipf_state_add(softc, &fi, (ipstate_t **)&ftp->ftp_pendstate,
998 ipf_p_ftp_server(softf, fin, ip, nat, ftp, dlen)
1003 ftpinfo_t *ftp;
1011 f = &ftp->ftp_side[1];
1015 DT2(ftp_server_response, char *, rptr, int, ftp->ftp_passok);
1022 rptr, ftp->ftp_passok);
1023 if (ftp->ftp_passok == FTPXY_GO) {
1025 inc = ipf_p_ftp_pasv(softf, fin, ip, nat, ftp, dlen);
1027 inc = ipf_p_ftp_epsv(softf, fin, ip, nat, ftp, dlen);
1035 inc = ipf_p_ftp_pasv(softf, fin, ip, nat, ftp, dlen);
1037 inc = ipf_p_ftp_epsv(softf, fin, ip, nat, ftp, dlen);
1039 ftp->ftp_passok = FTPXY_INIT;
1040 else if (ftp->ftp_incok) {
1042 if (ftp->ftp_passok == FTPXY_ACCT_1)
1043 ftp->ftp_passok = FTPXY_GO;
1045 ftp->ftp_passok++;
1047 switch (ftp->ftp_passok)
1054 ftp->ftp_passok = FTPXY_GO;
1057 ftp->ftp_passok += 3;
1062 ftp->ftp_incok = 0;
1066 rptr, ftp->ftp_passok);
1067 DT3(ftp_server_passok, char *,rptr, int, ftp->ftp_incok,
1068 int, ftp->ftp_passok);
1257 ipf_p_ftp_valid(softf, ftp, side, buf, len)
1259 ftpinfo_t *ftp;
1267 ftps = &ftp->ftp_side[side];
1286 ipf_p_ftp_process(softf, fin, nat, ftp, rv)
1290 ftpinfo_t *ftp;
1307 f = &ftp->ftp_side[rv];
1308 t = &ftp->ftp_side[1 - rv];
1508 f->ftps_junk = ipf_p_ftp_valid(softf, ftp, rv, rptr,
1534 f->ftps_junk = ipf_p_ftp_valid(softf, ftp, rv,
1550 nat, ftp, len);
1553 nat, ftp, len);
1561 * ftp proxy for this connection.
1636 ftpinfo_t *ftp;
1639 ftp = aps->aps_data;
1640 if (ftp == NULL)
1644 if (ftp->ftp_side[1 - rev].ftps_ifp == NULL)
1645 ftp->ftp_side[1 - rev].ftps_ifp = fin->fin_ifp;
1647 return ipf_p_ftp_process(softf, fin, nat, ftp, rev);
1659 ftpinfo_t *ftp;
1662 ftp = aps->aps_data;
1663 if (ftp == NULL)
1667 if (ftp->ftp_side[rev].ftps_ifp == NULL)
1668 ftp->ftp_side[rev].ftps_ifp = fin->fin_ifp;
1670 return ipf_p_ftp_process(softf, fin, nat, ftp, 1 - rev);
1707 ipf_p_ftp_eprt(softf, fin, ip, nat, ftp, dlen)
1712 ftpinfo_t *ftp;
1733 f = &ftp->ftp_side[0];
1738 return ipf_p_ftp_eprt4(softf, fin, ip, nat, ftp, dlen);
1741 return ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen);
1749 ipf_p_ftp_eprt4(softf, fin, ip, nat, ftp, dlen)
1754 ftpinfo_t *ftp;
1768 f = &ftp->ftp_side[0];
1899 return ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, port, inc);
1904 ipf_p_ftp_epsv(softf, fin, ip, nat, ftp, dlen)
1909 ftpinfo_t *ftp;
1918 (ftp->ftp_side[0].ftps_cmd != FTPXY_C_EPSV)) {
1919 DT1(epsv_cmd, int, ftp->ftp_side[0].ftps_cmd);
1922 ftp->ftp_side[0].ftps_cmd);
1925 f = &ftp->ftp_side[1];
1980 return ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, (u_int)ap,
1986 ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen)
1991 ftpinfo_t *ftp;
2011 f = &ftp->ftp_side[0];
2013 f = &ftp->ftp_side[0];
2192 return ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, port, inc);