model-net-method.h 1.34 KB
Newer Older
1
/*
Philip Carns's avatar
Philip Carns committed
2
 * Copyright (C) 2013 University of Chicago.
3
 * See COPYRIGHT notice in top-level directory.
Philip Carns's avatar
Philip Carns committed
4
 *
5 6 7 8 9 10 11 12 13
 */

#ifndef MODELNET_METHOD_H
#define MODELNET_METHOD_H

#include <ross.h>

struct model_net_method
{
14
    uint64_t packet_size; /* packet size */
15
    void (*mn_setup)(const void* net_params); /* For initializing the network */
16
    tw_stime (*model_net_method_packet_event)(
17 18
        char* category, 
        tw_lpid final_dest_lp, 
19
        uint64_t packet_size, 
20 21
        int is_pull,
        uint64_t pull_size, /* only used when is_pull==1 */
22
        tw_stime offset,
23 24 25 26
        int remote_event_size,  /* 0 means don't deliver remote event */
        const void* remote_event,
        int self_event_size,    /* 0 means don't deliver self event */
        const void* self_event,
27 28
        tw_lpid src_lp, // original caller of model_net_(pull_)event
        tw_lp *sender, // lp message is being called from (base LP)
29 30 31 32
	int is_last_pckt);
    void (*model_net_method_packet_event_rc)(tw_lp *sender);
    const tw_lptype* (*mn_get_lp_type)();
    int (*mn_get_msg_sz)();
33
    void (*mn_report_stats)();
34
    tw_lpid (*model_net_method_find_local_device)(tw_lp *sender);
35 36
};

37 38
extern struct model_net_method * method_array[];

39 40 41 42 43 44 45 46 47 48
#endif /* MODELNET_METHOD_H */

/*
 * Local variables:
 *  c-indent-level: 4
 *  c-basic-offset: 4
 * End:
 *
 * vim: ft=c ts=8 sts=4 sw=4 expandtab
 */