5 int getport(fr, name, port)
14 if (fr == NULL || fr->fr_type != FR_T_IPF) {
15 s = getservbyname(name, NULL);
24 * Some people will use port names in rules without specifying
25 * either TCP or UDP because it is implied by the group head.
26 * If we don't know the protocol, then the best we can do here is
27 * to take either only the TCP or UDP mapping (if one or the other
28 * is missing) or make sure both of them agree.
30 if (fr->fr_proto == 0) {
31 s = getservbyname(name, "tcp");
36 s = getservbyname(name, "udp");
41 if ((p1 == 0) && (s == NULL))
50 if ((fr->fr_flx & FI_TCPUDP) != 0) {
52 * If a rule is "tcp/udp" then check that both TCP and UDP
53 * mappings for this protocol name match ports.
55 s = getservbyname(name, "tcp");
59 s = getservbyname(name, "udp");
60 if (s == NULL || s->s_port != p1)
66 p = getprotobynumber(fr->fr_proto);
67 s = getservbyname(name, p ? p->p_name : NULL);