FACT++  1.0
int dna_write ( int  conn_id,
void *  buffer,
int  size 
)

Definition at line 455 of file dna.c.

References WRITE_ITEM::buffer, WRITE_ITEM::conn_id, DNA_HEADER::data_size, do_dna_write(), dtq_start_timer(), HDR_MAGIC, DNA_HEADER::header_magic, DNA_HEADER::header_size, id, id_get(), Memory::malloc(), READ_HEADER_SIZE, WRITE_ITEM::size, and SRC_DNA.

Referenced by dic_release_service(), handle_dns_info(), handle_registration(), register_services(), remove_service(), request_dns_single_info(), send_dns_update_packet(), and unregister_service().

456 {
457  WRITE_ITEM *newp;
458  int id;
459  WRITE_DATA *pktp;
460  DNA_HEADER *headerp;
461 
462  DISABLE_AST
463 
464  pktp = malloc((size_t)(READ_HEADER_SIZE+size));
465  headerp = &(pktp->header);
466  headerp->header_size = htovl(READ_HEADER_SIZE);
467  headerp->data_size = htovl(size);
468  headerp->header_magic = (int)htovl(HDR_MAGIC);
469 
470  memcpy(pktp->data, (char *)buffer, (size_t)size);
471 
472  newp = malloc(sizeof(WRITE_ITEM));
473  newp->conn_id = conn_id;
474  newp->buffer = pktp;
475  newp->size = size+READ_HEADER_SIZE;
476  id = id_get((void *)newp, SRC_DNA);
478  ENABLE_AST
479  return(1);
480 }
int conn_id
Definition: dna.c:364
#define HDR_MAGIC
Definition: dim.h:209
#define READ_HEADER_SIZE
Definition: dna.c:21
int header_magic
Definition: dim.h:357
int header_size
Definition: dim.h:355
void * malloc()
Definition: EventBuilder.cc:99
char id[4]
Definition: FITS.h:71
int size
Definition: dna.c:366
static int do_dna_write(int id)
Definition: dna.c:370
void dtq_start_timer(int time, void(*user_routine)(), dim_long tag)
Definition: dtq.c:790
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
int size
Definition: db_dim_server.c:17
int data_size
Definition: dim.h:356
int id_get(void *ptr, SRC_TYPES type)
Definition: conn_handler.c:152
void * buffer
Definition: dna.c:365

+ Here is the call graph for this function:

+ Here is the caller graph for this function: