///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2025 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
/* state machine of a HC as the MC sees */

digraph state_mach_mc_hc {
  // states
  node [fontsize=20];
  // start state (invisible)
  START [style=invis]
  // durable states
  node [shape=box,style="filled,rounded",fillcolor=lightgray];
  IDLE;
  ACTIVE [height=1.5,width=3,fixedsize=true,fontsize=28];
  OVERLOADED;
  DOWN;
  // transient states
  node[shape=box,style=rounded];
  CONFIGURING;
  CONFIGURING_OVERLOADED;
  EXITING;
  // edges
  edge [fontsize=14];
  START -> IDLE [arrowtail=odot];
  {IDLE; ACTIVE} -> CONFIGURING [label="configure()/\nCONFIGURE"];
  CONFIGURING -> ACTIVE [label="CONFIGURE_ACK"];
  CONFIGURING -> IDLE [label="CONFIGURE_NAK/\nerror"];
  ACTIVE -> OVERLOADED [label="CREATE_NAK/\nnotify"];
  ACTIVE -> ACTIVE [label="create_mtc()/\nCREATE_MTC"];
  ACTIVE -> ACTIVE [label="CREATE_REQ/\nCREATE_PTC"];
  OVERLOADED -> ACTIVE [label="HC_READY/\nnotify"];
  OVERLOADED -> CONFIGURING_OVERLOADED [label="configure()/\nCONFIGURE"];
  CONFIGURING_OVERLOADED -> OVERLOADED [label="CONFIGURE_ACK"];
  CONFIGURING_OVERLOADED -> IDLE [label="CONFIGURE_NAK/\nerror"];
  CONFIGURING_OVERLOADED -> CONFIGURING [label="HC_READY/\nnotify"];
  {IDLE; CONFIGURING; ACTIVE; OVERLOADED; CONFIGURING_OVERLOADED} -> EXITING [label="shutdown_session()/\nEXIT_HC"];
  EXITING -> DOWN [label="connection termination"];
  // error handling edges
  // commented out, to get a clearer picture :)
  /*
  {IDLE; CONFIGURING; ACTIVE; OVERLOADED; CONFIGURING_OVERLOADED} -> DOWN [label="connection termination/\nerror"];
  */
}
