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 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:10
Which of the following components of a pid controlled accumulates the error over time and responds to system error after the error has been accumulated? a)- proportional b)- derivative c)- integral d)- on/off.
Answers: 2
question
Engineering, 04.07.2019 19:10
Acircular aluminum shaft mounted in a journal is shown. the symmetric clearance gap between the shaft and journal is filled with sae 10w-30 oil at t 30°c. the shaft is caused to turn by the attached mass and cord. develop and solve a differential equation for the angular speed of the shaft as a function of time.
Answers: 2
question
Engineering, 06.07.2019 02:30
1in2 processor chip can be modelled as an isothermal plane wall of silicon, isothermal on both sides. the power input to the bottom of the plane wall, or the processing power of the chip, often called the thermal design power (tdp), is 100w. assume the periphery is adiabatic. the silicon is 400 microns thick. the temperature at the junction, or in this case on the bottom of the isothermal plane wall, is 85°c. what is the top surface temperature, assuming that the only mode of heat transfer is conduction
Answers: 1
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
Mathematics, 16.12.2020 22:50
question
Mathematics, 16.12.2020 22:50
question
Mathematics, 16.12.2020 22:50
question
Mathematics, 16.12.2020 22:50
question
Mathematics, 16.12.2020 22:50
question
Mathematics, 16.12.2020 22:50
question
Mathematics, 16.12.2020 22:50
Questions on the website: 13722361