link.c (3b0f8d2ed641ceeded11c0d3f253b0cacbf00880) | link.c (b6217683dc0269a53b799399522dbdfb5a4919cc) |
---|---|
1/*- 2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: link.c,v 1.1.2.14 1998/03/20 19:48:08 brian Exp $ | 26 * $Id: link.c,v 1.1.2.15 1998/04/03 19:21:33 brian Exp $ |
27 * 28 */ 29 30#include <sys/param.h> 31#include <netinet/in.h> 32#include <netinet/in_systm.h> 33#include <netinet/ip.h> 34 --- 154 unchanged lines hidden (view full) --- 189 190 if (type == PROTO_IN) 191 l->proto_in[i]++; 192 else 193 l->proto_out[i]++; 194} 195 196void | 27 * 28 */ 29 30#include <sys/param.h> 31#include <netinet/in.h> 32#include <netinet/in_systm.h> 33#include <netinet/ip.h> 34 --- 154 unchanged lines hidden (view full) --- 189 190 if (type == PROTO_IN) 191 l->proto_in[i]++; 192 else 193 l->proto_out[i]++; 194} 195 196void |
197link_ReportProtocolStatus(struct link *l) | 197link_ReportProtocolStatus(struct link *l, struct prompt *prompt) |
198{ 199 int i; 200 | 198{ 199 int i; 200 |
201 prompt_Printf(&prompt, " Protocol in out " | 201 prompt_Printf(prompt, " Protocol in out " |
202 "Protocol in out\n"); 203 for (i = 0; i < NPROTOSTAT; i++) { | 202 "Protocol in out\n"); 203 for (i = 0; i < NPROTOSTAT; i++) { |
204 prompt_Printf(&prompt, " %-9s: %8lu, %8lu", | 204 prompt_Printf(prompt, " %-9s: %8lu, %8lu", |
205 ProtocolStat[i].name, l->proto_in[i], l->proto_out[i]); 206 if ((i % 2) == 0) | 205 ProtocolStat[i].name, l->proto_in[i], l->proto_out[i]); 206 if ((i % 2) == 0) |
207 prompt_Printf(&prompt, "\n"); | 207 prompt_Printf(prompt, "\n"); |
208 } 209 if (!(i % 2)) | 208 } 209 if (!(i % 2)) |
210 prompt_Printf(&prompt, "\n"); | 210 prompt_Printf(prompt, "\n"); |
211} | 211} |