subject
Engineering, 28.02.2020 19:51 kactus

Your job is to do the following: 1. Using the template, assign the correct values to byte1 byte2, byte3, byte4 using the bit shift and bitwise AND operators, combined with the lastByteMask. 2. Then, generate a SubNet mask by using the lastByteMask and the bitwise NOT) operator, and store it in the variable subnetMask. This will result in a SubNet mask of Ox00 for this problem. Please note that bitwise NOT is a unary operator that takes a single argument 3. Using the AND & operator and the SubNet mask, generate the network addresses for IPAddr and localAddress and store the results in variables networkAddress1 and networkAddress2. 4. Using the network addresses, bitwise XOR (9) operator, and if /else, determine if the packet came from the local network. If the XOR of the two network addresses is o print the packet is from the local network.\n". Otherwise, print 'The packet is not from the local network.\n". Example output: Please input the IP Address: 2130706433 Subnet mask: Ox00 The IP address is: 127.0.0.1 The packet is not from the local network. LAB ACTIVITY 3.23.1: IP Address Conversion main. c Load default template... i #include 2 #include // Used to create variables of uint32_t data type 4 int main(void) 51 // uint32_t specifies a 4 byte (32 bit) unsigned // integer, whose size of 4 bytes remains fixed // across all machines. uint32_t IPAddr, bytel, byte2, byte3, byte4; uint32_t lastByteMask = exFF; uint32_t localAddress = 3232235777; uint32_t subnetMask, networkAddressi, networkAddress2; printf("Please input the IP Address:\n"); scanf("%u", SIPAddr); /* Generate Subnet Mask from lastByteMask using the bitwise NOT here */

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified β€œx” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 18:20
Vibration monitoring this technique uses the noise or vibration created by mechanical equipment and in seme cases by plant systems to detemine their actual condtion. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:20
Have a greater impact on maintenance productivity than any other support group. (clo5) a)-the top management b)-inventory and purchasing c)-sub-contracting d)-cmms
Answers: 2
question
Engineering, 04.07.2019 18:20
The characteristic roots of a dynamic system are: 1.7920 1.8160 i, -1.7920 1.8160 i, -0.4160 what is the order of this system? what are the settling time and damping ratio of the system?
Answers: 3
You know the right answer?
Your job is to do the following: 1. Using the template, assign the correct values to byte1 byte2, by...
Questions
question
Biology, 21.11.2020 04:20
question
Mathematics, 21.11.2020 04:20
question
Mathematics, 21.11.2020 04:20
question
Mathematics, 21.11.2020 04:20
question
Mathematics, 21.11.2020 04:20
question
Mathematics, 21.11.2020 04:20
question
Mathematics, 21.11.2020 04:20
Questions on the website: 13722360