-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprinter.c
62 lines (50 loc) · 830 Bytes
/
printer.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// main funcs
#include <stdio.h>
#include "subnt.h"
void nprinta(const unsigned int ar[4])
{
unsigned short int i = 0;
for (i=0; i<4; i++) {
(i == 3)? printf("%d", ar[i]): printf("%d.", ar[i]);
}
printf("\n");
}
void nprint_mask()
{
printf("Subnet Mask: ");
nprinta(mask);
}
void nprint_id()
{
printf("Network ID: ");
nprinta(nid);
printf("Broadcast ID: ");
nprinta(bid);
}
void nprint_range()
{
printf("First IP: ");
nprinta(ipf);
printf("Last IP: ");
nprinta(ipl);
}
void nprint_hostn()
{
printf("Hosts: ");
printf("%d\n", hostn);
}
void nprint_full()
{
printf("Subnet Mask: ");
nprinta(mask);
printf("Hosts: ");
printf("%d\n", hostn);
printf("Network ID: ");
nprinta(nid);
printf("Broadcast ID: ");
nprinta(bid);
printf("First IP: ");
nprinta(ipf);
printf("Last IP: ");
nprinta(ipl);
}