예제 #1
0
void SendQueryToServerUpdateSymmetricNATStatus(int nSock, int NATStatus)
{
    char tmpstr[256];
	int i;
	char mac[64];
    // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	//  Start out our HTTP session by requesting a page.
	// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	GetHostMACID(mac);
	sprintf(tmpstr,"GET /BMS/cameraservice?action=command&command=symmetricnatstatus&status=%d&mac=%s",NATStatus,mac);
	senda( nSock, tmpstr);
	// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	//  Finally we finish off the HTTP request.
	// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	senda( nSock, " HTTP/1.0\r\n\r\n" );
}
예제 #2
0
파일: driver.c 프로젝트: vivekp/minix-1
/*===========================================================================*
 *				flt_senda				     *
 *===========================================================================*/
static int flt_senda(message *mess, int which)
{
    /* Send a message to one driver. Can only return OK at the moment. */
    int r;
    asynmsg_t *amp;

    /* Fill in the last bits of the message. */
    mess->BDEV_MINOR = driver[which].minor;
    mess->BDEV_ID = 0;

    /* Send the message asynchronously. */
    amp = &amsgtable[which];
    amp->dst = driver[which].endpt;
    amp->msg = *mess;
    amp->flags = AMF_VALID;
    r = senda(amsgtable, 2);

    if(r != OK)
        panic("senda returned error: %d", r);

    return r;
}