Question: Using library functions like htonl and Unixs bcopy or Windows CopyMemory, implement a routine that generates the same onthe-wire representation of the structures given in

Using library functions like htonl and Unix’s bcopy or Windows’

CopyMemory, implement a routine that generates the same onthe-wire representation of the structures given in Exercise 1 as XDR does. If possible, compare the performance of your “by-hand”

encoder/decoder with the corresponding XDR routines.

Exercise 1

#define MAXSTR 100 struct date I 1: char month[MAXSTR]: int day: int

where num_raises + 1 corresponds to the number of valid entries in array salary_history. Show the on-the-wire representation of employee0 that is generated by XDR.

#define MAXSTR 100 struct date I 1: char month[MAXSTR]: int day: int year: struct employee ! 1: char name[MAXSTR]: int ssn: struct date *hireday: int salary_history [5]: num_raises: int static struct date date0 ("MAY". 5. 19961: static struct date datel - ("JANUARY". 7. 2002): static struct employee employee0 - ("RICHARD". 4376. &date0. (14000. 35000. 47000. 0. 01. 21: - ("MARY". 4377. &datel. (90000. 150000. 0. 0. 01. 1): static struct employee employeel

Step by Step Solution

3.26 Rating (144 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the image youve provided it looks like we have two C structures date and employee employee contains an array of salaryhistory an int for numraises and a date structure for hireday To match th... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Networking Questions!