Ejemplo n.º 1
0
/*---------------------------------------------------------------------------*/
static void
recv_broadcast(struct broadcast_conn *c, const rimeaddr_t *from)
{
  process_incoming_packet();
  if(is_sender) {
  } else if(construct_reply(from)) {
    broadcast_send(&broadcast);
  }
}
Ejemplo n.º 2
0
/*******************************************************************
*   Finds interface the ARP Request was received from and constructs ARP Reply to send back out of 
*   the received interface. 
*******************************************************************/
void got_Request(struct packet_state * ps, struct sr_arphdr * arp_hdr, const struct sr_ethernet_hdr* eth)
{
	assert(ps);
	assert(arp_hdr);
	assert(eth);
	
	struct sr_if *iface = sr_get_interface(ps->sr, ps->interface);
	assert(iface);
	construct_reply(ps, arp_hdr, iface->addr, eth);
}
Ejemplo n.º 3
0
/*---------------------------------------------------------------------------*/
static void
recv_unicast(struct unicast_conn *c, const rimeaddr_t *from)
{
  process_incoming_packet();
  if(is_sender) {
    struct datapath_msg *msg = packetbuf_dataptr();
    if(msg->datapath_command == DATAPATH_COMMAND_ECHO_REPLY) {
      process_post(&shell_netperf_process, CONTINUE_EVENT, NULL);
    }
  } else if(construct_reply(from)) {
    unicast_send(&unicast, from);
  }
}
Ejemplo n.º 4
0
static void
recv_mesh(struct mesh_conn *c, const rimeaddr_t *from, uint8_t hops)
{
  process_incoming_packet();
  if(is_sender) {
    if(construct_next_echo()) {
      mesh_send(&mesh, &receiver);
    }
  } else {
    if(construct_reply(from)) {
      mesh_send(&mesh, from);
    }
  }
}
/****************************************************************************
  process an smb from the client - split out from the process() code so
  it can be used by the oplock break code.
****************************************************************************/
void process_smb(char *inbuf, char *outbuf, int ProcSockID, int threadid)
{
//  extern int Client;
#ifdef WITH_SSL
#endif /* WITH_SSL */
  int msg_type = CVAL(inbuf,0);
  int32 len = smb_len(inbuf);
  int nread = len + 4;

#ifdef WITH_PROFILE
  profile_p->smb_count++;
#endif

#ifdef WITH_VTP
  if(trans_num == 1 && VT_Check(inbuf)) 
  {
    VT_Process();
    return;
  }
#endif
  if(msg_type == 0x85)
    return; /* Keepalive packet. */

  nread = construct_reply(inbuf,outbuf,nread,max_send[threadid], ProcSockID
  					,threadid );
      
  if(nread > 0) 
  {
	
    if (nread != smb_len(outbuf) + 4) 
    {
    }
    else 
      send_smb(ProcSockID,outbuf);
  }
}