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
Awall of 0.5m thickness is to be constructed from a material which has average thermal conductivity of 1.4 w/mk. the wall is to be insulated with a material having an average thermal conductivity of 0.35 w/mk so that heat loss per square meter shall not exceed 1450 w. assume inner wall surface temperature of 1200°c and outer surface temperature of the insulation to be 15°c. calculate the thickness of insulation required.
Answers: 3
question
Engineering, 04.07.2019 18:20
Steam enters a converging nozzle at 3.0 mpa and 500°c with a at 1.8 mpa. for a nozzle exit area of 32 cm2, determine the exit velocity, mass flow rate, and exit mach number if the nozzle: negligible velocity, and it exits (a) is isentropic (b) has an efficiency of 94 percent
Answers: 2
question
Engineering, 04.07.2019 18:20
Avolume of 2.65 m3 of air in a rigid, insulated container fitted with a paddle wheel is initially at 264 k, 5.6 bar. the air receives 432 kj by work from the paddle wheel. assuming the ideal gas model with cv = 0.71 kj/kg • k, determine for the air the amount of entropy produced, in kj/k
Answers: 2
question
Engineering, 04.07.2019 18:20
Find the minimum film thickness for a journal bearing with the data below. shaft diameter, d-50 mm, clearance ratio, cdratio? 0.001, shaft speed, n 2000 rpm; bearing length. i 200 mm; eccentricity ration, ? -0.55. ( note, cdratio-ca/d) the minimum film thickness is um
Answers: 2
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
Advanced Placement (AP), 22.08.2019 08:10
question
Mathematics, 22.08.2019 08:10
question
Biology, 22.08.2019 08:10
question
Mathematics, 22.08.2019 08:10
Questions on the website: 13722367