headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / boot / loader / net / NetDefs.cpp
blob19b7681090f9e9d739c42c64278c8d94fff1781b
1 /*
2 * Copyright 2005, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
6 #include <boot/net/NetDefs.h>
8 #include <stdio.h>
10 const mac_addr_t kBroadcastMACAddress(
11 (uint8[6]){0xff, 0xff, 0xff, 0xff, 0xff, 0xff});
12 const mac_addr_t kNoMACAddress((uint8[6]){0, 0, 0, 0, 0, 0});
14 // net service names
15 const char *const kEthernetServiceName = "ethernet";
16 const char *const kARPServiceName = "arp";
17 const char *const kIPServiceName = "ip";
18 const char *const kUDPServiceName = "udp";
19 const char *const kTCPServiceName = "tcp";
22 // constructor
23 NetService::NetService(const char *name)
24 : fName(name)
28 // destructor
29 NetService::~NetService()
33 // NetServiceName
34 const char *
35 NetService::NetServiceName()
37 return fName;
40 // CountSubNetServices
41 int
42 NetService::CountSubNetServices() const
44 return 0;
47 // SubNetServiceAt
48 NetService *
49 NetService::SubNetServiceAt(int index) const
51 return NULL;
54 // FindSubNetService
55 NetService *
56 NetService::FindSubNetService(const char *name) const
58 int count = CountSubNetServices();
59 for (int i = 0; i < count; i++) {
60 NetService *service = SubNetServiceAt(i);
61 if (strcmp(service->NetServiceName(), name) == 0)
62 return service;
65 return NULL;