dart/gni/ds_base_gni.c
static int ds_register_cp(struct dart_server *ds, struct app_info *app)
{
	struct msg_buf *msg;
	struct node_id *peer = ds->peer_tab;
        //struct app_info *app;
	int err = -ENOMEM;
	int i, j;

	struct gni_smsg_attr_info *cur_attr_info;
	struct gni_smsg_attr_info *attr_info;
	gni_smsg_attr_t	*smsg_attr;

	int info_size;	

	msg = msg_buf_alloc(ds->rpc_s, peer, 1);
	if (!msg) 
		goto err_out;

	msg->msg_rpc->cmd = sp_announce_cp;
	msg->msg_rpc->id = ds->rpc_s->ptlmap.id;

    cur_attr_info = (struct gni_smsg_attr_info *)(msg->msg_rpc->pad);
	cur_attr_info->appid = app->app_id;

	attr_info = ds->rpc_s->attr_info_start;
	
	while(attr_info->appid != app->app_id) {
		attr_info = attr_info->next;
	}

	cur_attr_info->local_smsg_attr = attr_info->local_smsg_attr;

	err = rpc_send(ds->rpc_s, peer, msg);
	if (err != 0){
		free(msg);
		goto err_out;
	}

    return 0;

err_out:
	printf("(%s): failed. (%d)\n", __func__, err);
	return err;

}
// Slave server respond to master server with its attr for app.

Slave server respond to master server with its attr for app.
Slave server respond to master server with its attr for app .
static int ds_register_cp(struct dart_server *ds, struct app_info *app)
{
	struct msg_buf *msg;
	struct node_id *peer = ds->peer_tab;
	int err = -ENOMEM;
	int i, j;
	struct gni_smsg_attr_info *cur_attr_info;
	struct gni_smsg_attr_info *attr_info;
	gni_smsg_attr_t	*smsg_attr;
	int info_size;	
	msg = msg_buf_alloc(ds->rpc_s, peer, 1);
	if (!msg) 
		goto err_out;
	msg->msg_rpc->cmd = sp_announce_cp;
	msg->msg_rpc->id = ds->rpc_s->ptlmap.id;
    cur_attr_info = (struct gni_smsg_attr_info *)(msg->msg_rpc->pad);
	cur_attr_info->appid = app->app_id;
	attr_info = ds->rpc_s->attr_info_start;
	while(attr_info->appid != app->app_id) {
		attr_info = attr_info->next;
	}
	cur_attr_info->local_smsg_attr = attr_info->local_smsg_attr;
	err = rpc_send(ds->rpc_s, peer, msg);
	if (err != 0){
		free(msg);
		goto err_out;
	}
    return 0;
err_out:
	printf("(%s): failed. (%d)\n", __func__, err);
	return err;
}
static int ds_register_cp ( struct dart_server * ds , struct app_info * app ) { struct msg_buf * msg ; struct node_id * peer = ds -> peer_tab ; int err = - ENOMEM ; int i , j ; struct gni_smsg_attr_info * cur_attr_info ; struct gni_smsg_attr_info * attr_info ; gni_smsg_attr_t * smsg_attr ; int info_size ; msg = msg_buf_alloc ( ds -> rpc_s , peer , 1 ) ; if ( ! msg ) goto err_out ; msg -> msg_rpc -> cmd = sp_announce_cp ; msg -> msg_rpc -> id = ds -> rpc_s -> ptlmap . id ; cur_attr_info = ( struct gni_smsg_attr_info * ) ( msg -> msg_rpc -> pad ) ; cur_attr_info -> appid = app -> app_id ; attr_info = ds -> rpc_s -> attr_info_start ; while ( attr_info -> appid != app -> app_id ) { attr_info = attr_info -> next ; } cur_attr_info -> local_smsg_attr = attr_info -> local_smsg_attr ; err = rpc_send ( ds -> rpc_s , peer , msg ) ; if ( err != 0 ) { free ( msg ) ; goto err_out ; } return 0 ; err_out : printf ( " \n " , __func__ , err ) ; return err ; }
Slave server respond to master server with its attr for app.
Slave server respond to master server with its attr for app .
//struct app_info *app;
