2 * $Id: ORTEThreadUtils.c,v 0.0.0.1 2003/08/21
4 * DEBUG: section 25 Thread utility
5 * AUTHOR: Petr Smolik petr.smolik@wo.cz
7 * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/
8 * --------------------------------------------------------------------
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
24 /*****************************************************************************/
26 ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,u_int16_t port) {
27 struct sockaddr_in des;
30 des.sin_family = AF_INET;
31 des.sin_port = htons(port); //to receiving port
32 if (d->domainProp.IFCount) {
33 for(i=0;i<d->domainProp.IFCount;i++) {
34 des.sin_addr.s_addr=htonl(d->domainProp.IFProp[i].ipAddress);
35 sock_sendto(sock,&i,1,&des,sizeof(des));
36 debug(25,2) ("Sent wake up signal to: %s.%d\n",
37 IPAddressToString(ntohl(des.sin_addr.s_addr)),
41 des.sin_addr.s_addr = inet_addr("127.0.0.1"); //local IPAddress
42 sock_sendto(sock,NULL,0,&des,sizeof(des));
43 debug(25,2) ("Sent wake up signal to: %s.%d\n",
44 IPAddressToString(ntohl(des.sin_addr.s_addr)),
49 /*****************************************************************************/
51 ORTEDomainWakeUpSendingThread(ObjectEntry *objectEntry) {
52 if (objectEntry->htimNeedWakeUp)
53 pthread_mutex_unlock(&objectEntry->htimSendMutex);