1 |
/* |
/* |
2 |
* Copyright (C) 2004-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2004-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: net.c,v 1.6 2006/09/05 06:58:29 debug Exp $ |
* $Id: net.c,v 1.9 2007/04/28 00:10:11 debug Exp $ |
29 |
* |
* |
30 |
* Emulated network. |
* Emulated network. |
31 |
* |
* |
101 |
fail: |
fail: |
102 |
fprintf(stderr, "net_allocate_ethernet_packet_link(): out of memory\n"); |
fprintf(stderr, "net_allocate_ethernet_packet_link(): out of memory\n"); |
103 |
exit(1); |
exit(1); |
104 |
|
|
105 |
|
/* Gets rid of a compiler warning: */ |
106 |
|
return NULL; |
107 |
} |
} |
108 |
|
|
109 |
|
|
789 |
exit(1); |
exit(1); |
790 |
} |
} |
791 |
|
|
792 |
memset((char *)&si_self, sizeof(si_self), 0); |
memset((char *)&si_self, 0, sizeof(si_self)); |
793 |
si_self.sin_family = AF_INET; |
si_self.sin_family = AF_INET; |
794 |
si_self.sin_port = htons(local_port); |
si_self.sin_port = htons(local_port); |
795 |
si_self.sin_addr.s_addr = htonl(INADDR_ANY); |
si_self.sin_addr.s_addr = htonl(INADDR_ANY); |