title: Accessing LayerFieldsContainer using variable in pyshark
body: <p>I'm using pyshark to parse pcap files. I want to access layer fields using variable as shown in simple example below:<br>
  For example to access ntp server ip:
  </p>
  
  <pre><code>p = cap[0]
  print(p.bootp.option_ntp_server)
  </code></pre>
  
  <p>However, I want to access it like this:
  </p>
  
  <pre><code>option_list = {
      "12": "option_hostname",
      "60": "option_vendor_class_id",
      "43": "option_ntp_server"
      }
  
  p = cap[0]
  print(p.bootp.%s %(option_list["43"]))
  </code></pre>
  
  <p>Of course this kind of access is not possible. So I tried to use <code>getattr()</code> like this:</p>
  
  <pre><code>getOption = getattr(p.bootp, option_list["43"])
  getOption()
  </code></pre>
  
  <p>And it gave me following error:</p>
  
  <pre><code>'LayerFieldsContainer' object is not callable
  </code></pre>
  
  <p>It seems pyshark packet or layer classes is not callable.</p>
  
  <p>How I can access layer fields using variable? Or can you suggest me another method to access options using option type numbers? Because I want to access this fields using option type numbers (Like option 12, option 43), not using titles.</p>