diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2011-07-13 15:08:25 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2011-07-13 15:08:25 +0000 |
commit | c1cdf2a3c1f56c75b22212b9f07085204c7058cb (patch) | |
tree | 84a013affa1170e59cd8e49c455a90a0931b5763 /usr.sbin | |
parent | a183c0ae6a1621e0e47b92bd3818617a8bf3dffd (diff) |
fix indentation in switch
ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/asr.c | 18 | ||||
-rw-r--r-- | usr.sbin/smtpd/pack.c | 176 | ||||
-rw-r--r-- | usr.sbin/smtpd/print.c | 180 |
3 files changed, 184 insertions, 190 deletions
diff --git a/usr.sbin/smtpd/asr.c b/usr.sbin/smtpd/asr.c index 8a41f255823..5e14944cb3b 100644 --- a/usr.sbin/smtpd/asr.c +++ b/usr.sbin/smtpd/asr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asr.c,v 1.8 2011/05/07 13:16:17 eric Exp $ */ +/* $OpenBSD: asr.c,v 1.9 2011/07/13 15:08:24 eric Exp $ */ /* * Copyright (c) 2010,2011 Eric Faurot <eric@openbsd.org> * @@ -1946,14 +1946,14 @@ asr_add_sockaddr2(struct asr_query *aq, int port; switch (protocol) { - case IPPROTO_TCP: - proto = "tcp"; - break; - case IPPROTO_UDP: - proto = "udp"; - break; - default: - proto = NULL; + case IPPROTO_TCP: + proto = "tcp"; + break; + case IPPROTO_UDP: + proto = "udp"; + break; + default: + proto = NULL; } port = -1; diff --git a/usr.sbin/smtpd/pack.c b/usr.sbin/smtpd/pack.c index e139512e4bc..04612d1a530 100644 --- a/usr.sbin/smtpd/pack.c +++ b/usr.sbin/smtpd/pack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pack.c,v 1.2 2011/03/27 17:39:17 eric Exp $ */ +/* $OpenBSD: pack.c,v 1.3 2011/07/13 15:08:24 eric Exp $ */ /* * Copyright (c) 2009,2010 Eric Faurot <eric@faurot.net> * @@ -260,55 +260,49 @@ unpack_rr(struct packed *p, struct rr *rr) switch(rr->rr_type) { - case T_CNAME: - unpack_dname(p, rr->rr.cname.cname, - sizeof(rr->rr.cname.cname)); - break; - - case T_MX: - unpack_u16(p, &rr->rr.mx.preference); - unpack_dname(p, rr->rr.mx.exchange, - sizeof(rr->rr.mx.exchange)); - break; - - case T_NS: - unpack_dname(p, rr->rr.ns.nsname, - sizeof(rr->rr.ns.nsname)); - break; - - case T_PTR: - unpack_dname(p, rr->rr.ptr.ptrname, - sizeof(rr->rr.ptr.ptrname)); - break; - - case T_SOA: - unpack_dname(p, rr->rr.soa.mname, - sizeof(rr->rr.soa.mname)); - unpack_dname(p, rr->rr.soa.rname, - sizeof(rr->rr.soa.rname)); - unpack_u32(p, &rr->rr.soa.serial); - unpack_u32(p, &rr->rr.soa.refresh); - unpack_u32(p, &rr->rr.soa.retry); - unpack_u32(p, &rr->rr.soa.expire); - unpack_u32(p, &rr->rr.soa.minimum); - break; - - case T_A: - if (rr->rr_class != C_IN) - goto other; - unpack_inaddr(p, &rr->rr.in_a.addr); - break; - - case T_AAAA: - if (rr->rr_class != C_IN) - goto other; - unpack_in6addr(p, &rr->rr.in_aaaa.addr6); - break; - default: - other: - rr->rr.other.rdata = p->data + p->offset; - rr->rr.other.rdlen = rdlen; - p->offset += rdlen; + case T_CNAME: + unpack_dname(p, rr->rr.cname.cname, sizeof(rr->rr.cname.cname)); + break; + + case T_MX: + unpack_u16(p, &rr->rr.mx.preference); + unpack_dname(p, rr->rr.mx.exchange, sizeof(rr->rr.mx.exchange)); + break; + + case T_NS: + unpack_dname(p, rr->rr.ns.nsname, sizeof(rr->rr.ns.nsname)); + break; + + case T_PTR: + unpack_dname(p, rr->rr.ptr.ptrname, sizeof(rr->rr.ptr.ptrname)); + break; + + case T_SOA: + unpack_dname(p, rr->rr.soa.mname, sizeof(rr->rr.soa.mname)); + unpack_dname(p, rr->rr.soa.rname, sizeof(rr->rr.soa.rname)); + unpack_u32(p, &rr->rr.soa.serial); + unpack_u32(p, &rr->rr.soa.refresh); + unpack_u32(p, &rr->rr.soa.retry); + unpack_u32(p, &rr->rr.soa.expire); + unpack_u32(p, &rr->rr.soa.minimum); + break; + + case T_A: + if (rr->rr_class != C_IN) + goto other; + unpack_inaddr(p, &rr->rr.in_a.addr); + break; + + case T_AAAA: + if (rr->rr_class != C_IN) + goto other; + unpack_in6addr(p, &rr->rr.in_aaaa.addr6); + break; + default: + other: + rr->rr.other.rdata = p->data + p->offset; + rr->rr.other.rdlen = rdlen; + p->offset += rdlen; } if (p->err) @@ -416,47 +410,47 @@ pack_rrdynamic(struct packed *p, const struct rr_dynamic *rd) rr = &rd->rd; switch(rd->rd_type) { - case T_CNAME: - pack_dname(p, rr->cname.cname); - break; - - case T_MX: - pack_u16(p, rr->mx.preference); - pack_dname(p, rr->mx.exchange); - break; - - case T_NS: - pack_dname(p, rr->ns.nsname); - break; - - case T_PTR: - pack_dname(p, rr->ptr.ptrname); - break; - - case T_SOA: - pack_dname(p, rr->soa.mname); - pack_dname(p, rr->soa.rname); - pack_u32(p, rr->soa.serial); - pack_u32(p, rr->soa.refresh); - pack_u32(p, rr->soa.retry); - pack_u32(p, rr->soa.expire); - pack_u32(p, rr->soa.minimum); - break; - - case T_A: - if (rd->rd_class != C_IN) - goto other; - pack_inaddr(p, rr->in_a.addr); - break; - - case T_AAAA: - if (rd->rd_class != C_IN) - goto other; - pack_in6addr(p, rr->in_aaaa.addr6); - break; - default: - other: - pack_data(p, rr->other.rdata, rr->other.rdlen); + case T_CNAME: + pack_dname(p, rr->cname.cname); + break; + + case T_MX: + pack_u16(p, rr->mx.preference); + pack_dname(p, rr->mx.exchange); + break; + + case T_NS: + pack_dname(p, rr->ns.nsname); + break; + + case T_PTR: + pack_dname(p, rr->ptr.ptrname); + break; + + case T_SOA: + pack_dname(p, rr->soa.mname); + pack_dname(p, rr->soa.rname); + pack_u32(p, rr->soa.serial); + pack_u32(p, rr->soa.refresh); + pack_u32(p, rr->soa.retry); + pack_u32(p, rr->soa.expire); + pack_u32(p, rr->soa.minimum); + break; + + case T_A: + if (rd->rd_class != C_IN) + goto other; + pack_inaddr(p, rr->in_a.addr); + break; + + case T_AAAA: + if (rd->rd_class != C_IN) + goto other; + pack_in6addr(p, rr->in_aaaa.addr6); + break; + default: + other: + pack_data(p, rr->other.rdata, rr->other.rdlen); } if (p->err) diff --git a/usr.sbin/smtpd/print.c b/usr.sbin/smtpd/print.c index d31a81f2db6..d9505151ac8 100644 --- a/usr.sbin/smtpd/print.c +++ b/usr.sbin/smtpd/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.2 2011/03/27 17:39:17 eric Exp $ */ +/* $OpenBSD: print.c,v 1.3 2011/07/13 15:08:24 eric Exp $ */ /* * Copyright (c) 2009,2010 Eric Faurot <eric@faurot.net> * @@ -182,45 +182,45 @@ print_rr(struct rr *rr, char *buf, size_t max) buf += r; switch(rr->rr_type) { - case T_CNAME: - print_dname(rr->rr.cname.cname, buf, max); - break; - case T_MX: - snprintf(buf, max, "%"PRIu32" %s", - rr->rr.mx.preference, - print_dname(rr->rr.mx.exchange, tmp, sizeof tmp)); - break; - case T_NS: - print_dname(rr->rr.ns.nsname, buf, max); - break; - case T_PTR: - print_dname(rr->rr.ptr.ptrname, buf, max); - break; - case T_SOA: - snprintf(buf, max, - "%s %s %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32, - print_dname(rr->rr.soa.rname, tmp, sizeof tmp), - print_dname(rr->rr.soa.mname, tmp2, sizeof tmp2), - rr->rr.soa.serial, - rr->rr.soa.refresh, - rr->rr.soa.retry, - rr->rr.soa.expire, - rr->rr.soa.minimum); - break; - case T_A: - if (rr->rr_class != C_IN) - goto other; - snprintf(buf, max, "%s", inet_ntoa(rr->rr.in_a.addr)); - break; - case T_AAAA: - if (rr->rr_class != C_IN) - goto other; - snprintf(buf, max, inet6_ntoa(rr->rr.in_aaaa.addr6)); - break; - default: - other: - snprintf(buf, max, "(rdlen=%"PRIu16 ")", rr->rr.other.rdlen); - break; + case T_CNAME: + print_dname(rr->rr.cname.cname, buf, max); + break; + case T_MX: + snprintf(buf, max, "%"PRIu32" %s", + rr->rr.mx.preference, + print_dname(rr->rr.mx.exchange, tmp, sizeof tmp)); + break; + case T_NS: + print_dname(rr->rr.ns.nsname, buf, max); + break; + case T_PTR: + print_dname(rr->rr.ptr.ptrname, buf, max); + break; + case T_SOA: + snprintf(buf, max, + "%s %s %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32, + print_dname(rr->rr.soa.rname, tmp, sizeof tmp), + print_dname(rr->rr.soa.mname, tmp2, sizeof tmp2), + rr->rr.soa.serial, + rr->rr.soa.refresh, + rr->rr.soa.retry, + rr->rr.soa.expire, + rr->rr.soa.minimum); + break; + case T_A: + if (rr->rr_class != C_IN) + goto other; + snprintf(buf, max, "%s", inet_ntoa(rr->rr.in_a.addr)); + break; + case T_AAAA: + if (rr->rr_class != C_IN) + goto other; + snprintf(buf, max, inet6_ntoa(rr->rr.in_aaaa.addr6)); + break; + default: + other: + snprintf(buf, max, "(rdlen=%"PRIu16 ")", rr->rr.other.rdlen); + break; } return (res); @@ -253,45 +253,45 @@ print_rrdynamic(struct rr_dynamic *rd, char *buf, size_t max) buf += r; switch(rd->rd_type) { - case T_CNAME: - print_dname(rd->rd.cname.cname, buf, max); - break; - case T_MX: - snprintf(buf, max, "%"PRIu32" %s", - rd->rd.mx.preference, - print_dname(rd->rd.mx.exchange, tmp, sizeof tmp)); - break; - case T_NS: - print_dname(rd->rd.ns.nsname, buf, max); - break; - case T_PTR: - print_dname(rd->rd.ptr.ptrname, buf, max); - break; - case T_SOA: - snprintf(buf, max, - "%s %s %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32, - print_dname(rd->rd.soa.rname, tmp, sizeof tmp), - print_dname(rd->rd.soa.mname, tmp2, sizeof tmp2), - rd->rd.soa.serial, - rd->rd.soa.refresh, - rd->rd.soa.retry, - rd->rd.soa.expire, - rd->rd.soa.minimum); - break; - case T_A: - if (rd->rd_class != C_IN) - goto other; - snprintf(buf, max, "%s", inet_ntoa(rd->rd.in_a.addr)); - break; - case T_AAAA: - if (rd->rd_class != C_IN) - goto other; - snprintf(buf, max, inet6_ntoa(rd->rd.in_aaaa.addr6)); - break; - default: - other: - snprintf(buf, max, "(rdlen=%"PRIu16 ")", rd->rd.other.rdlen); - break; + case T_CNAME: + print_dname(rd->rd.cname.cname, buf, max); + break; + case T_MX: + snprintf(buf, max, "%"PRIu32" %s", + rd->rd.mx.preference, + print_dname(rd->rd.mx.exchange, tmp, sizeof tmp)); + break; + case T_NS: + print_dname(rd->rd.ns.nsname, buf, max); + break; + case T_PTR: + print_dname(rd->rd.ptr.ptrname, buf, max); + break; + case T_SOA: + snprintf(buf, max, + "%s %s %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32, + print_dname(rd->rd.soa.rname, tmp, sizeof tmp), + print_dname(rd->rd.soa.mname, tmp2, sizeof tmp2), + rd->rd.soa.serial, + rd->rd.soa.refresh, + rd->rd.soa.retry, + rd->rd.soa.expire, + rd->rd.soa.minimum); + break; + case T_A: + if (rd->rd_class != C_IN) + goto other; + snprintf(buf, max, "%s", inet_ntoa(rd->rd.in_a.addr)); + break; + case T_AAAA: + if (rd->rd_class != C_IN) + goto other; + snprintf(buf, max, inet6_ntoa(rd->rd.in_aaaa.addr6)); + break; + default: + other: + snprintf(buf, max, "(rdlen=%"PRIu16 ")", rd->rd.other.rdlen); + break; } return (res); @@ -379,17 +379,17 @@ print_addr(struct sockaddr *sa, char *buf, size_t len) print_host(sa, h, sizeof h); switch (sa->sa_family) { - case AF_INET: - snprintf(buf, len, "%s:%i", h, - ntohs(((struct sockaddr_in*)(sa))->sin_port)); - break; - case AF_INET6: - snprintf(buf, len, "[%s]:%i", h, - ntohs(((struct sockaddr_in6*)(sa))->sin6_port)); - break; - default: - snprintf(buf, len, "?"); - break; + case AF_INET: + snprintf(buf, len, "%s:%i", h, + ntohs(((struct sockaddr_in*)(sa))->sin_port)); + break; + case AF_INET6: + snprintf(buf, len, "[%s]:%i", h, + ntohs(((struct sockaddr_in6*)(sa))->sin6_port)); + break; + default: + snprintf(buf, len, "?"); + break; } return (buf); |