Pion-pion interaction in s-and p-waves and their applications to certain three-pion and four-pion systems