Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/icmp/icmp.c

    r849ed54 r19f857a  
    4242#include <stdint.h>
    4343#include <str.h>
     44
    4445#include <ipc/ipc.h>
    4546#include <ipc/services.h>
     47
    4648#include <sys/time.h>
    4749#include <sys/types.h>
    4850
    49 #include <net_err.h>
    50 #include <net_messages.h>
    51 #include <net_modules.h>
    52 #include <packet/packet_client.h>
    53 #include <net_byteorder.h>
    54 #include <net_checksum.h>
    55 #include <icmp_api.h>
    56 #include <icmp_client.h>
    57 #include <icmp_codes.h>
    58 #include <icmp_common.h>
    59 #include <icmp_interface.h>
    60 #include <il_interface.h>
    61 #include <inet.h>
    62 #include <ip_client.h>
    63 #include <ip_interface.h>
    64 #include <ip_protocols.h>
    65 #include <net_interface.h>
    66 #include <socket_codes.h>
    67 #include <socket_errno.h>
    68 #include <tl_messages.h>
    69 #include <icmp_messages.h>
    70 #include <icmp_header.h>
     51#include "../../err.h"
     52#include "../../messages.h"
     53#include "../../modules.h"
     54
     55#include "../../structures/packet/packet_client.h"
     56
     57#include "../../include/byteorder.h"
     58#include "../../include/checksum.h"
     59#include "../../include/icmp_api.h"
     60#include "../../include/icmp_client.h"
     61#include "../../include/icmp_codes.h"
     62#include "../../include/icmp_common.h"
     63#include "../../include/icmp_interface.h"
     64#include "../../include/il_interface.h"
     65#include "../../include/inet.h"
     66#include "../../include/ip_client.h"
     67#include "../../include/ip_interface.h"
     68#include "../../include/ip_protocols.h"
     69#include "../../include/net_interface.h"
     70#include "../../include/socket_codes.h"
     71#include "../../include/socket_errno.h"
     72
     73#include "../../tl/tl_messages.h"
    7174
    7275#include "icmp.h"
     76#include "icmp_header.h"
     77#include "icmp_messages.h"
    7378#include "icmp_module.h"
    74 
    75 /** ICMP module name.
    76  */
    77 #define NAME    "ICMP protocol"
    7879
    7980/** Default ICMP error reporting.
     
    819820}
    820821
    821 #ifdef CONFIG_NETWORKING_modular
    822 
    823 #include <tl_standalone.h>
    824 
    825 /** Default thread for new connections.
    826  *
    827  *  @param[in] iid The initial message identifier.
    828  *  @param[in] icall The initial message call structure.
    829  *
    830  */
    831 static void tl_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    832 {
    833         /*
    834          * Accept the connection
    835          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    836          */
    837         ipc_answer_0(iid, EOK);
    838        
    839         while(true) {
    840                 ipc_call_t answer;
    841                 int answer_count;
    842                
    843                 /* Clear the answer structure */
    844                 refresh_answer(&answer, &answer_count);
    845                
    846                 /* Fetch the next message */
    847                 ipc_call_t call;
    848                 ipc_callid_t callid = async_get_call(&call);
    849                
    850                 /* Process the message */
    851                 int res = tl_module_message(callid, &call, &answer, &answer_count);
    852                
    853                 /* End if said to either by the message or the processing result */
    854                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    855                         return;
    856                
    857                 /* Answer the message */
    858                 answer_call(callid, res, &answer, answer_count);
    859         }
    860 }
    861 
    862 /** Starts the module.
    863  *
    864  *  @param argc The count of the command line arguments. Ignored parameter.
    865  *  @param argv The command line parameters. Ignored parameter.
    866  *
    867  *  @returns EOK on success.
    868  *  @returns Other error codes as defined for each specific module start function.
    869  *
    870  */
    871 int main(int argc, char *argv[])
    872 {
    873         ERROR_DECLARE;
    874        
    875         /* Print the module label */
    876         printf("Task %d - %s\n", task_get_id(), NAME);
    877        
    878         /* Start the module */
    879         if (ERROR_OCCURRED(tl_module_start(tl_client_connection))) {
    880                 printf(" - ERROR %i\n", ERROR_CODE);
    881                 return ERROR_CODE;
    882         }
    883        
    884         return EOK;
    885 }
    886 
    887 #endif /* CONFIG_NETWORKING_modular */
    888 
    889822/** @}
    890823 */
Note: See TracChangeset for help on using the changeset viewer.