Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project description In this project, you are required to implement a new IPC method called Notification - Based IPC ( NIPC ) . A NIPC
Project description
In this project, you are required to implement a new IPC method called NotificationBased IPC NIPC A NIPC instance is a system resource identified by a unique key. Any process that has the key may access the NIPC instance to sendreceive messages. The procedure to use a NIPC instance is as follows:
A process opens a NIPC instance using its key.
A process subscribes under a specific type to the opened NIPC instance to receive messages
A process may send messages to an opened NIPC instance using any of the following:
Broadcast: message is sent to all subscribed processes.
Multicast: message is sent to all subscribed processes of certain type.
Unicast: message is sent to a specific subscribed processes.
When a message is sent to the NIPC instance, all intended subscribers are notified. The notified process then have the choice of reading the message or ignoring it
Implementation details
You are required to implement the following functions and submit a library named nipc.h along with its c file Make sure you perform all necessary testing before submitting the code.
int nipccreatekeytkey;
Description : This function creates a NIPC instance that has a key key. If a NIPC instance with the same key exists, the function fails.
Return value : on success, on failures.
Errors : On failure, errno is set to an appropriate error value. You may define any errors you may need.
int nipcgetkeytkey
Description : This function opens a NIPC instance whose key is key.
Return value : If the instance exists, it returns a unique positive nonzero integer to identify the instance within the process. Otherwise, it returns
Errors : On failure, errno is set to an appropriate error value. You may define any errors you may need.
int nipcsubscribeint id long type, void handlerstruct nipcmessage;
Description : This function subscribes the calling process to the opened NIPC instance identified by id under the specified type "type". The function handler is invoked upon any notification from the NIPC instance.
Return value : The function returns on success, and otherwise.
Errors : On failure, errno is set to an appropriate error value. You may define any errors you may need.
int nipcsendint id struct nipcmessage msg long type;
Description : This function sends the message msg to the NIPC instance identified by id If type the message is treated as a broadcast. If type the message is treated as a unicast and type is the PID of the receiver. If type the message is treated as a multicast to all receivers subscribed to type type The function sends notifications and delivers the message to the intended receivers.
Return value : This function returns on success, and on failure.
Errors : On failure, errno is set to an appropriate error value. You may define any errors you may need.
int nipccloseint id
Description : This function closes a NIPC instance identified by id A closed NIPC instance cannot be used unless opened again.
Return value : Returns on success, and on failures.
Errors : On failure, errno is set to an appropriate error value. You may define any errors you may need.
int nipcremove keytkey
Description : This function removes an NIPC instance identified by key from the system.
Return value : Returns on success, and on failures.
Errors : On failure, errno is set to an appropriate error value. You may define any errors you may need.
Requirements
The project must be implemented in groups. The maximum group size is
All group members must be involved in the design and implementation of the project. Failing to prove collaborative work between group members will affect the grade of the whole group.
Submissions must be made through the Elearning system, submissions by any other means are not acceptable.
Submission deadline is January
E
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started