Development of a unix peer-to-peer file transfer application

Assignment Help C/C++ Programming
Reference no: EM131491009

Assignment Phase

Background

This assignment aims to assess your C programming skills and forms the second phase of the development of a UNIX peer-to-peer file transfer application. The second phase of the assignment will build on from phase 1 to add network communications through sockets and the ability to handle multiple peers connecting simultaneously and will require asynchronous programming techniques.

You will be expected to submit not only the source code to your program but also a complete design for your program. The design can use pseudocode, flowcharts, functional decomposition, or another form of design and will be assessed on usefulness, correctness and coverage.

Objectives

Design and develop a program that does the following:

Loads and uses a configuration file, called settings.conf;

-set (at minimum) the following internal variables

  • Username
  • Port
  • IP address
  • Logfile filename

-If the configuration file doesn't exist, your program should create one with default values and log the event.

-If the configuration file is not readable, your program should continue with default settings and log an appropriate message.

-Any line beginning with a '#' character should be ignored as a comment.

Loads and uses a "sharing list" file that contains a list of records containing the following data:

  • Filename of the file to be shared
  • Full path of the file to be shared
  • Sharing permissions for the file (Either shared with all or shared with individual users)
  • If the sharing list file itself does not exist, it should be created.
  • When the program starts it should check that each listed file exists and is readable. If it does not exist or is not readable, the file should be removed from the sharing list file.

Maintains a sharing list and allows the user to add or remove files (with appropriate sharing permissions) to/from the sharing list

  • Add/remove individual file
  • Add/remove all files within a directory

Loads and uses a "friends list" file that contains a list of known peer records containing the following data:

  • IP address/hostname
  • Port
  • Username
  • If the friends list file itself does not exist, it should be created

Maintains a friends list and allows the user to add or remove friends to/from the friends list

Allows the user to connect to a peer in the friends list and receive a listing of files shared by that peer (those that the user has permission to access)

Allows the user to request a file to be downloaded from that peer.

  • Downloaded files should be saved in a "downloads" folder.

Allows multiple peers to connect and download files simultaneously from a single peer

If the SIGQUIT (3) or SIGTERM (15) signals are received, your program should:

  • Signal any children still active to terminate (if appropriate): If the children do not respond in a timely manner, your program should KILL (9) them
  • Log an appropriate message to the log file
  • Close all open files

If the SIGHUP (1) signal is received (you will have to trap this signal) then

  • Record the request in the log file
  • open your programs configuration file
  • read in the configuration file
  • reset your programs parameters based on the configuration you read in
  • open your log file
  • record the final status of the SIGHUP process
  • All current socket connections will need to be migrated over to any new network settings

Contains a logging facility that logs at leastthe following information to a file:

  • Program started (on IP:port)
  • Program exited
  • Sharing list created
  • Friend list created
  • File added to sharing list
  • File removed from sharing list
  • Friend added to friends list
  • Friend removed from friends list
  • Peer connected
  • Peer disconnected
  • File upload
  • File download

The logger should run asa separate process and allow asynchronous requests to log information.

GNU Make should be used to build the application from source and your makefile should contain at least "make" and "make clean" build targets.

Functions should be loosely coupled and highly cohesive wherever possible.Your program source should be well structured and make use of multiple .c files and appropriate header files with clear separation of concerns.

Your submission should include, at minimum, the following files:

files.cand files.h

This should contain your main() program and code associated with your programs main logic such as reading and loading your configuration, maintaining file lists, taking input for instructions.

io.cand io.h

This should contain your code to do with input and output in general. This will be mainly File and screen i/o for phase one.

logger.cand logger.h

This should contain all your code associated with logging.

networking.cand networking.h

This should contain all your code associated with establishing connections to peers or sending data over a network.

settings.conf

makefile

So you think you're done:

Does your program compile and run?

Is your program in multiple files and is then linked together? Using #include to copy .c files into your main program file is NOT appropriate!

Does your program load and use a friends list save file?

Can you edit the friends list? (Add/remove/view file and user entries)

Does your program deal with bad input?

Can a peer select a file from your sharing list and download it?

Can multiple instances of your program download files from you simultaneously?

Can you select a file from a peer's sharing list and download it?

Do you use fgets(), fputs() and/or fprintf() and avoid scanf() and printf()?

Does your program create a logfile if one doesn't exist?

Does your logger actually record the required events in the logfile?

Does your logger run in a separate process?

Do you handle the SIGQUIT, SIGTERM and SIGHUP signals?

Does each of your functions do only one thing?

Need it as per the guidelines.

Attachment:- Assignment File.rar

Reference no: EM131491009

Questions Cloud

Calculate core return of net operating assets : Analyzing a Change in Core Operating Profitability (Easy) The following numbers were calculated from the financial statements for a firm for 2012 and 2011.
Economic break-even point : he BowGus Archery Company management estimates that its new Galactically Flexible Bow project will have to generate EBIT of $20,000 each year to be viable.
Describe how apple achieved business success : Assignment: Management Information System- Explain how Apple achieved business success through the use of information, information technology, and people.
Fixed costs or the variable cost per unit increase : How much can either the fixed costs or the variable cost per unit increase before the company has a negative EBIT.
Development of a unix peer-to-peer file transfer application : This assignment aims to assess your C programming skills and forms the second phase of the development of a UNIX peer-to-peer file transfer application
What is the molar mass : 2.00 moles of a gas occupies 62.2 L at a par- ticular temperature and pressure. Its density is 0.900 g/L. What is the molar mass?
Analyze a change in return on common equity : Analyzing a Change in Return on Common Equity (Easy) The following numbers were calculated from the financial statements for a firm for 2012 and 2011.
First half of the nineteenth century : Explain how and why was democracy expanded and/or restricted in the first half of the nineteenth century.
Protestant reformations so aggressively : Why did the Western Christian Church choose to combat the protestant reformations so aggressively? (Around 150 words)

Reviews

len1491009

5/10/2017 6:24:30 AM

These are some of the things we will be looking for when we mark your assignment. These are testing guidelines and do not entail all of the testing you will need to do to ensure you meet all of the assignment requirements. You should look to make your program as robust as possible. You will be expected to submit not only the source code to your program but also a complete design for your program. The design can use pseudocode, flowcharts, functional decomposition, or another form of design and will be assessed on usefulness, correctness and coverage.

Write a Review

C/C++ Programming Questions & Answers

  Create an array of slip objects

Create an array of Slip objects. You should populate the array with 10 slips, entering information into all fields of the Slip object. (Make sure that all customers have a valid slip number in their information, and mark that slip as rented.)

  Write a test program to test the various operations

Write the definitions of the member functions as described in the definition of the class testClass.

  Create a program that outputs the result of the formula

Create a program that outputs the result of the formula f = (a - b)(x - y) using the printf() functions.

  Write a function that takes two positive integer arguments

Write a function named "g_c_d" that takes two positive integer arguments and returns as its value the greatest common divisor of those two integers. If the function is passed an argument that is not positive (i.e., greater than zero).

  Write one input function to input one number

Write one input function to input one number, returning that value via the return statement to the calling function. You will need to call this function 4 times to get all 4 values

  This function should accept a two-dimensional

getLowestInRow. This function should accept a two-dimensional array as its argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the lowest value in the specif..

  The stack-based routing scheme

the stack-based routing scheme you are to have a stack of maze locations.

  Create a number of security threats

"Footprinting is considered to be the most challenging but possibly the most important step during an attempt to carry out an intrusion". Critically discuss the above statement.

  Write test program to call function several times for gcd

Greatest common divisor of two integers is largest integer which will evenly divide both integers. Implement this function in assembly language and write test program which calls function several times, passing it different values.

  Design a c++ program containing a class fraction.

Test your class in the main() method by creating several fractions, adding them, subtracting them, and printing the result by using the / sign (e.g., 2/3), not as decimal fractions. Also demonstrate usage of the overloaded operators.

  Add a sentinel command to stop the loop

add a sentinel command to stop the loop. When the program is compiled, It'll ask the user to type in a palindrome. I want the user to type EXIT to end the loop.

  Write c program to read one ip address

Write a C or C++ program which Read one IP address at a time from Dec_IPAddresses.txt and convert it into Hex. Store converted values stored in another file (e.g. HEX_IPAddresses.txt).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd