13 #include "rofl/common/protocols/clldpattr.h"
14 #include "rofl/common/logging.h"
15 #include "rofl/common/croflexception.h"
27 std::map<uint8_t, clldpattr*> attrs;
77 pack(uint8_t *buf = (uint8_t*)0,
size_t buflen = 0);
83 unpack(uint8_t *buf,
size_t buflen);
114 has_chassis_id()
const;
165 has_port_desc()
const;
183 has_system_name()
const;
201 has_system_desc()
const;
219 has_system_caps()
const;
231 operator<< (std::ostream& os,
clldpattrs const& attrs) {
232 os <<
rofl::indent(0) <<
"<clldpattrs #attrs:" << attrs.attrs.size() <<
" >" << std::endl;
234 if (attrs.has_chassis_id()) {
235 os << dynamic_cast<clldpattr_id&>( *(attrs.attrs.at(LLDPTT_CHASSIS_ID)) );
237 if (attrs.has_port_id()) {
238 os << dynamic_cast<clldpattr_id&>( *(attrs.attrs.at(LLDPTT_PORT_ID)) );
240 if (attrs.has_ttl()) {
241 os << dynamic_cast<clldpattr_ttl&>( *(attrs.attrs.at(LLDPTT_TTL)) );
243 for (std::map<uint8_t, clldpattr*>::const_iterator
244 it = attrs.attrs.begin(); it != attrs.attrs.end(); ++it) {
249 case LLDPTT_CHASSIS_ID: {
252 case LLDPTT_PORT_ID: {
258 case LLDPTT_PORT_DESC: {
259 os << dynamic_cast<clldpattr_desc&>( *(it->second) );
261 case LLDPTT_SYSTEM_NAME: {
262 os << dynamic_cast<clldpattr_desc&>( *(it->second) );
264 case LLDPTT_SYSTEM_DESC: {
265 os << dynamic_cast<clldpattr_desc&>( *(it->second) );
267 case LLDPTT_SYSTEM_CAPS: {
268 os << dynamic_cast<clldpattr_system_caps&>( *(it->second) );
270 case LLDPTT_MGMT_ADDR:
272 os << dynamic_cast<clldpattr&>( *(it->second) );
276 if (attrs.has_end()) {
277 os << dynamic_cast<clldpattr_end&>( *(attrs.attrs.at(LLDPTT_END)) );
Definition: clldpattr.h:128
Definition: clldpattr.h:504
Definition: clldpattrs.h:23
Definition: clldpattrs.h:22
Definition: clldpattr.h:598
Definition: clldpattr.h:416
Definition: clldpattr.h:245
Definition: clldpattr.h:299
Definition: clldpattrs.h:21
Definition: clldpattrs.h:25
Definition: croflexception.h:27